bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
Does anyone have a talkaction where I put it for example /teleport "player" so it is sent to your temple? tfs 1.5
local talkaction = TalkAction("/t")
local effect = CONST_ME_TELEPORT
function talkaction.onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
if param == '' then
player:teleportTo(player:getTown():getTemplePosition())
player:getPosition():sendMagicEffect(effect)
end
local target = Player(param)
if not target then
player:sendCancelMessage("A player with that name is not online.")
return false
end
target:teleportTo(player:getTown():getTemplePosition())
target:getPosition():sendMagicEffect(effect)
target:sendTextMessage(MESSAGE_INFO_DESCR, 'You have been teleported from ['..player:getName()..'] to temple.')...
local talkaction = TalkAction("/t")
local effect = CONST_ME_TELEPORT
function talkaction.onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
if param == '' then
player:teleportTo(player:getTown():getTemplePosition())
player:getPosition():sendMagicEffect(effect)
end
local target = Player(param)
if not target then
player:sendCancelMessage("A player with that name is not online.")
return false
end
target:teleportTo(player:getTown():getTemplePosition())
target:getPosition():sendMagicEffect(effect)
target:sendTextMessage(MESSAGE_INFO_DESCR, 'You have been teleported from ['..player:getName()..'] to temple.')
return false
end
talkaction:separator(" ")
talkaction:register()
local teleportAllAction = TalkAction("/tp all")
local effect = CONST_ME_TELEPORT
function teleportAllAction.onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
for _, onlinePlayer in ipairs(Game.getPlayers()) do
local templePosition = onlinePlayer:getTown():getTemplePosition()
onlinePlayer:teleportTo(templePosition)
onlinePlayer:getPosition():sendMagicEffect(effect)
onlinePlayer:sendTextMessage(MESSAGE_STATUS_WARNING, "You have been teleported to your temple by " .. player:getName() .. ".")
end
return false
end
teleportAllAction:register()
local talkaction = TalkAction("/t")
local effect = CONST_ME_TELEPORT
function talkaction.onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
if param == '' then
player:sendCancelMessage("Usage: /t <player name>")
return false
end
local target = Player(param)
if not target then
player:sendCancelMessage("A player with that name is not online.")
return false
end
local townId = target:getTown():getId()
local templePosition = Town(townId):getTemplePosition()
target:teleportTo(templePosition)
target:getPosition():sendMagicEffect(effect)
target:sendTextMessage(MESSAGE_STATUS_WARNING, "You have been teleported from " .. player:getName() .. " to your temple.")
return false
end
talkaction:separator(" ")
talkaction:register()