• 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!

Boots

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
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"/>
 
Solution
I can't understand the last part what you mean with it gives more dash on other floors? Anyways try this one should work properly.
LUA:
local sands = {231,104}
local id_boot = 2643

function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if(isInArray(sands, item.itemid)) then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
doChangeSpeed(cid, 1000)
end
end
return true
end

function onStepOut(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if (getCreatureSpeed(cid) > getCreatureBaseSpeed(cid)) then
doChangeSpeed(cid, -1000)
end
return true
end
what exactly is the bug?
also, there's a speed limit in the game and some tiles are special, no matter your speed they will slow you down, I might be really wrong here but if thigs are the way I think they are, to make such a boots you'd need to change the tiles in your items.xml and maybe some creaturescripts or even source edits...
 
This script works properly for TFS 0.4, I have tested it with -speedGain and with speedGain no errors and it adds/removes the speed.
The only bug I can think of is that you added
LUA:
local speedGain = 10000
When client/source max speed are 1500 so you should change this value.
Or If you have any bugs with the script then you are not using 0.4 because I have test on both 3777/3884. Just post the bugs and I will try to help you.
 
Can you try this? I have only change the values and retested again, It adds speed on stepin and removes it on stepout, Works perfect with TFS 0.4
LUA:
local sands = {231,104}
local id_boot = 2643

function onStepIn(cid, item, position, fromPosition)

if(isInArray(sands, item.itemid)) then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
doChangeSpeed(cid, 1000)
end
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, -1000)
end
end
return true
end
 
try to add StepIn type for each individual id like this
XML:
<movevent event="StepIn" itemid="231" event="script" value="sandb.lua" />
<movevent event="StepOut" itemid="231" event="script" value="sandb.lua" />
<movevent event="StepIn" itemid="104" event="script" value="sandb.lua" />
<movevent event="StepOut" itemid="104" event="script" value="sandb.lua" />
 
This one should work try it and please next time write when errors happens because I thought its on the startup all this time.
LUA:
local sands = {231,104}
local id_boot = 2643

function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if(isInArray(sands, item.itemid)) then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
doChangeSpeed(cid, 1000)
end
end
return true
end

function onStepOut(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
if (getCreatureSpeed(cid) > getCreatureBaseSpeed(cid)) then
doChangeSpeed(cid, -1000)
end
end
return true
end
 
@Mustafa1337

it worked, but when I remove the boot from the player she keeps walking fast on the sand

I also noticed that he gives one more dash on other floors, when I remove the boots on another floor he walks as if he is running even more
 
Last edited:
I can't understand the last part what you mean with it gives more dash on other floors? Anyways try this one should work properly.
LUA:
local sands = {231,104}
local id_boot = 2643

function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if(isInArray(sands, item.itemid)) then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == id_boot then
doChangeSpeed(cid, 1000)
end
end
return true
end

function onStepOut(cid, item, position, fromPosition)
if not isPlayer(cid) then
return true
end
if (getCreatureSpeed(cid) > getCreatureBaseSpeed(cid)) then
doChangeSpeed(cid, -1000)
end
return true
end
 
Solution
Back
Top