PDA

View Full Version : Need help with corpse:isopen with module



Pirus
04-24-2021, 04:58 PM
Hello, I want my script to check if I'm bellow 100 cap, and if I am I want it to disable Looter. The thing is that I want him to check that cap amount ONLY while specified corpse is open (in this situation it's cyclops corpse). Thanks to that I will be able to modify my Looter content while off the corpse, and the script will turn it off or on only while on the corpse.

I tried something like this, but this does not work:


local container = Container:Name()
local dead = "Dead Cyclops"

if (container == dead) then
Module.New("checkCap", function()
if (Self.Cap() < 100) then
setLooterEnabled(false)
else
setLooterEnabled(true)
end
end)
end

Pirus
04-25-2021, 05:48 AM
Okay, I figured it out.



Module.New("checkCap", function()
local cont = Container.New("Dead Cyclops")
while cont:isOpen() do
if (Self.Cap() < 100) then
setLooterEnabled(false)
else
setLooterEnabled(true)
end
end
end)


Ofc main script needs to have Looter.Start() line somewhere at the start of the hunt route. Just in case someone will ever be looking for something like this.