• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Firewalker Boots help!

eardrums

Member
Joined
May 27, 2010
Messages
101
Solutions
1
Reaction score
11
Hi!

I am trying to make a script that makes you able to walk on lava if you only have firewalker boots on. If you dont then the lava will kill you. So this is what I did


Code:
local slot = 8

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -99999)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 20000)

function onStepIn(cid, item, pos)
    if isPlayer(cid) then
    if getPlayerSlotItem(cid, slot) == 2646 == TRUE then
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        elseif getPlayerSlotItem(cid, slot) == 2646 == FALSE then
        doCreatureSay(cid, "IT BURNS!", TALKTYPE_ORANGE_1)
        doAddCondition(cid, condition)
        end
end
return TRUE
end

Now the problem is that when I step on the lava regardless if I'm wearing the id 2646 it always burns me. I know 2646 is golden boots but lets just pretend thats the id for firewalker boots. Now I want to know what the problem is. What did I do wrong? Im still beginning to understand scripting :) and dont worry i didnt forget to type the lava id in the action files.
 
The if statements are not correct, I assume you get an error about this in your console.
Code:
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == 2646 then
 
I didn't.. but what is the part that isnt correct? can you rewrite the script with the correct way of the statement? I also tried typing CONST_SLOT_FEET but same result

NVM LIMOS I LOVE YOU I GOT IT! its all because i didnt have .itemid <<< :D
 
Last edited by a moderator:
Also the TRUE part doesn't belong in that if statement.
getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid returns a number, so only compare it with a number, if you use an old server, it's needed to use == TRUE if a function returns true or false, else you can just skip that in if statements.
 
Back
Top