up
5
2k
11 de abril de 2023 às 12:39
info
Grupo: Conde
Registrado: 11/03/13
Posts: 629
Reputação: +183

11 de abril de 2023 às 22:04
@MalBack vou considerar que está usando TFS 1.3
Troca o X, Y e Z
<action actionid="45001" event="script" value="teleportar.lua"/>
teleportar.lua:
local destination = Position(X, Y, Z) local cooldown_time = 30 -- em minutos local last_use = {} function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not player then return false end -- Verificar se passou o tempo do cooldown_time if last_use[cid] and os.time() - last_use[cid] < cooldown_time * 60 then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You must wait " .. cooldown_time .. " minutes before using this again.") return true end -- verificar se o player deu use no tile ou item correto if item and item.itemid ~= 0 then -- player deu use em um item player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot use this with an item.") return true end local tile = Tile(toPosition) if not tile or not tile:getItemById(0) then -- player deu use em um item que não existe ou em um tile vazio player:sendTextMessage(MESSAGE_STATUS_SMALL, "You must use this on a tile.") return true end -- teleport player and update last_use player:teleportTo(destination, true) last_use[cid] = os.time() return true end
13 de abril de 2023 às 11:33
Em 11/04/2023 em 22:04, GamerGoiano disse:@MalBack vou considerar que está usando TFS 1.3
Troca o X, Y e Z
<action actionid="45001" event="script" value="teleportar.lua"/>
teleportar.lua:
local destination = Position(X, Y, Z) local cooldown_time = 30 -- em minutos local last_use = {} function onUse(cid, item, fromPosition, itemEx, toPosition) local player = Player(cid) if not player then return false end -- Verificar se passou o tempo do cooldown_time if last_use[cid] and os.time() - last_use[cid] < cooldown_time * 60 then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You must wait " .. cooldown_time .. " minutes before using this again.") return true end -- verificar se o player deu use no tile ou item correto if item and item.itemid ~= 0 then -- player deu use em um item player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot use this with an item.") return true end local tile = Tile(toPosition) if not tile or not tile:getItemById(0) then -- player deu use em um item que não existe ou em um tile vazio player:sendTextMessage(MESSAGE_STATUS_SMALL, "You must use this on a tile.") return true end -- teleport player and update last_use player:teleportTo(destination, true) last_use[cid] = os.time() return true end
onde add essa linha " <action actionid="45001" event="script" value="teleportar.lua"/> " sei q deve ser em um arquivo xml . mas parece q o ot vem faltando pasta pq n tem os arquivo xml .
info
Grupo: Conde
Registrado: 11/03/13
Posts: 629
Reputação: +183

13 de abril de 2023 às 12:14
@MalBack actions.xml



info
Grupo: Campones
Registrado: 03/10/15
Posts: 15
Reputação: 0
Salve Rapaziada tudo bom .
queria ajuda pra cria um teleport ou uma alavanca com tempo ..
depois do player usa o teleport ou a lavanca ele so poderá usa depois de tal determinado tempo.
ex: Scarlett > drume > oberon<
SERVIDOR 12.91
Se alguem poder me ajuda vou fica grato ,
des de ja agradeço a todos.
..