super23
Member
- Joined
- Dec 27, 2013
- Messages
- 98
- Reaction score
- 5
I am trying to increase player speed by 1 speed unit using an item. But it doesnot produce the expected results.
I have tried printing out getSpeed and getBaseSpeed but those gave large numbers such as: 393478143.
There is no documentation about changeSpeed in TFS 1.x documentation on github.
How can I increase player speed by 1 unit each time the item is used?
What i've tried so far:
I have tried printing out getSpeed and getBaseSpeed but those gave large numbers such as: 393478143.
There is no documentation about changeSpeed in TFS 1.x documentation on github.
How can I increase player speed by 1 unit each time the item is used?
What i've tried so far:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:isPlayer() then
print(tostring(player:getSpeed()))
player:changeSpeed(player:getBaseSpeed() + 1)
end
return true
end