bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
Hello, I would like to know how do I create a boots that when put will walk faster in sand id. removing the player returns to normal speed. or when stepping out of the sand it doesn't work. I tried one but it bugged the sand.
TFS 0.4
TFS 0.4
LUA:
local speedGain = 10000 -- speed player
local sands = {231,104} -- Id
local id_boot = 2643 -- ID boots
function onStepIn(cid, item, position, fromPosition)
if(isInArray(sands, item.itemid)) then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
doChangeSpeed(cid, speedGain)
end
else
return false
end
return true
end
function onStepOut(cid, item, position, fromPosition)
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid ~= id_boot then
if (getCreatureSpeed(cid) > getCreatureBaseSpeed(cid)) then
doChangeSpeed(cid, -speedGain)
end
else
return false
end
return true
end
XML:
<movevent type="StepIn" itemid="231;104" event="script" value="sandb.lua"/>
<movevent type="StepOut" itemid="231;104" event="script" value="sandb.lua"/>

