I am using TFS 1.0 and my teleport ntiles command (/a) does not work.
Here is my codes:
talkactions.xml
and teleport_ntiles.lua
When I use the /a command nothing happens, does anyone know whats wrong?
Here is my codes:
talkactions.xml
Code:
<talkaction words="/a" separator=" " script="gamemaster/teleport_ntiles.lua" />
and teleport_ntiles.lua
Code:
function onSay(cid, words, param)
local player = Player(cid)
if not player:getGroup():getAccess() then
return true
end
local steps = tonumber(param)
if not steps then
return false
end
local position = player:getPosition()
position:getNextPosition(player:getDirection(), steps)
position = player:getClosestFreePosition(position, false)
if position.x == 0 then
player:sendCancelMessage("You cannot teleport there.")
return false
end
player:teleportTo(position)
return false
end
When I use the /a command nothing happens, does anyone know whats wrong?