• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spawn at temple after death

jlskelin

New Member
Joined
Mar 28, 2009
Messages
198
Reaction score
1
i need help when a player dies he spawns somewhere how to change that so he spawns at temple
 
i know the position but where can i find in the scripts when a player dies that he spawns at the pos not somewhere else
 
it's on player.cpp,
Code:
Player::Death
and you shouldn't edit it as it's loading the position from the map..
 
WrXssTu.png
 
i have 2 cities vip and temple but eve n when i use on god /t i go to vip not to temple i didnt find anything on player cpp

my temple position is x 1000 y 998 z 7 but when ui sue /t or a player dies it goe to x 1133 y 1152 z7
 
Last edited by a moderator:
You have 2 cities.
(More then likely) One of the temple positions is located at the second position.
Either change the temple positions to where you want them, or change the player's town to the other town.
When the character dies it checks what town they are in, and sends them to that town's temple position.

Town 1's temple position is [x = 1000, y = 1000, z = 7]
Town 2's temple position is [x= 2000, y = 2000, z = 7]

Player 1's Town is set to Town 1.
Player 1 dies. Is sent to Town 1's temple position. [x = 1000, y = 1000, z = 7]

Player 2's Town is set to Town 2.
Player 2 dies. Is sent to Town 2's temple position. [x= 2000, y = 2000, z = 7]

If you never change the characters townID then they will always spawn in Town 1's temple position.

Using the command "/t" sends you to your townID's temple position. (hometown)
Using the command "/town 1" "/town 2" will send you to that town's temple position.

If for whatever reason the TownID of the players is correct, then start looking into scripts on your server involving player death and/or login.
^ This is highly unlikely and I'm 93% sure it's regarding improperly set TownID's on the players.
 
What TFS version do you use?

In either case, make the temple have a citizen teleport.
The citizen teleport is basically a script, that changes the characters townID when a player walks through it.
(Like normal tibia.)

Here is a simple example given with most server's.
Place a teleport, with the temple position of that town, then add actionID (30020 + townID).
Town 1 actionID = 30021
Town 2 actionID = 30022
This is for TFS 0.3.7/0.3.6/0.4.
(And yes I accidently placed 20021 instead of 30021. my mistake.)
WufHR6r.png

data/movements/movements.xml

Code:
<movevent type="StepIn" itemid="1387" event="script" value="citizen.lua"/>
data/movements/scripts/citizen.lua
Code:
function onStepIn(cid, item, position, fromPosition)
   if(item.actionid > 30020 and item.actionid < 30100) then
     local townId = (item.actionid - 30020)
     doPlayerSetTown(cid, townId)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a resident of " .. getTownName(townId) .. ".")
   end
   return true
end
 
Back
Top