Tenta ai. Só criar um arquivo .lua no creaturescripts e por isso:
local hospitalpos = { [1] = {x = 1006, y = 1010, z = 7}, -- posições pra onde o player será teleportado ao morrer [2] = {x = 1006, y = 1015, z = 7}, [3] = {x = 1006, y = 1020, z = 7}, } local str = "MT" --storage para controlar se o player foi morto ou nao function onDeath(cid, position) registerCreatureEvent(cid, "DeathPlayerHospital_L") if isPlayer(cid) then setPlayerStorageValue(cid, str, 1) end return true end function onLogin(cid) registerCreatureEvent(cid, "DeathPlayerHospital") if isPlayer(cid) then if getPlayerStorageValue(cid, str) == 1 then setPlayerStorageValue(cid, str, -1) doTeleportThing(cid, hospitalpos[math.random(#hospitalpos)], true) end end return true end
TAG:
<event type="login" name="DeathPlayerHospital_L" event="script" value="arquivo.lua"/> <event type="death" name="DeathPlayerHospital" event="script" value="arquivo.lua"/>
Se quiser por mais posições só adicionar conforme o script. Daria pra fazer também um fromPosition e toPosition , assim o jogador se teleportaria pra qualquer lugar dentro das área configurada. Mas recomendo usar dessa maneira que te mandei.





info
Grupo: Campones
Registrado: 23/01/19
Posts: 37
Reputação: 0
Gênero: Masculino
Boa Tarde, Galera do Xtibia
Utilizo a distro
Tfs 0.4
Gostaria de saber se tem alguma forma de fazer os players que morrer ir para um hospital.
Só que teria varias salas[cabines] e os jogadores iriam logar após a morte em uma das salas[cabines]
Seria aleatório
Espero que vocês possam me ajudar
Rep ++