Hi, i'm trying to make talkaction command /goto waypoint like in old tfs version and i have a problem couse nothing happend.
Code:
function onSay(player, words, param)
local target = Creature(param)
local waypoint = getWaypointPositionByName(param)
if not player:getGroup():getAccess() then
return true
end
if target == nil then
player:sendCancelMessage("Creature not found.")
return false
else
player:teleportTo(target:getPosition())
return true
end
if waypoint == nil then
player:sendCancelMessage("Waypoint not found.")
return false
else
player:teleportTo(waypoint:getPosition())
return true
end
end
Code:
<talkaction words="/goto" separator=" " script="tpto.lua" />