forgottenserver/data/scripts/talkactions/position.lua
Michał "Gubihe cdb9c69d69
Many words in talkactions (#3137)
Support for multiple word triggers to a talkaction. 

Revscriptsys:
local talk = TalkAction("/pos", "!pos")

XML:
<talkaction words="!online;/online" script="online.lua" />
2020-11-08 12:14:55 +01:00

15 lines
486 B
Lua

local talk = TalkAction("/pos", "!pos")
function talk.onSay(player, words, param)
if player:getGroup():getAccess() and param ~= "" then
local split = param:split(",")
player:teleportTo(Position(split[1], split[2], split[3]))
else
local position = player:getPosition()
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your current position is: " .. position.x .. ", " .. position.y .. ", " .. position.z .. ".")
end
return false
end
talk:separator(" ")
talk:register()