-- /pos -> shows your current position -- /pos x, y, z -> teleports there (gamemaster and above) function onSay(player, words, param) local position = player:getPosition() if param == "" or not player:getGroup():getAccess() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Your current position is: " .. position.x .. ", " .. position.y .. ", " .. position.z .. ".") return false end local coords = {} for value in param:gmatch("%d+") do coords[#coords + 1] = tonumber(value) end if #coords ~= 3 then player:sendCancelMessage("Usage: /pos x, y, z") return false end local destination = Position(coords[1], coords[2], coords[3]) if not Tile(destination) then player:sendCancelMessage("There is no tile at " .. coords[1] .. ", " .. coords[2] .. ", " .. coords[3] .. ".") return false end if not player:isInGhostMode() then position:sendMagicEffect(CONST_ME_TELEPORT) end player:teleportTo(destination) if not player:isInGhostMode() then destination:sendMagicEffect(CONST_ME_TELEPORT) end return false end