PDA

View Full Version : REQUEST, IF CAP BELOW XX WALKER.GOTOLABEL



Fredrikdenstore
08-05-2016, 12:27 AM
Hello!

I have been trying to setup a script for hours now.

I want it to check my cap and when it is below xx it should jump to label "leave".

Is it even possible? xD :p

Feel free to help me if you know how to do it.

jaiminho
08-05-2016, 05:12 AM
local CAP_TO_DISABLE = 100

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "CheckCap") then
if (Self.Cap() < CAP_TO_DISABLE) then
gotoLabel("Leave")
else
gotoLabel("Start")
end
elseif (labelName == "StopWalker") then
Cavebot.Stop()
end
end


working for me.