• 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!

Lua Citizenship

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
44
How do i let my players decide which town to make home? I have no clue how to do this.. When they die i want them to spawn in place of their choosing
 
First of all, you need to configure the towns/ID in your Map Editor. (CTRL+T), then you can put a lever or switch in each town temple, with the following action:

LUA:
function onUse(cid, item, frompos, item2, topos)

newtemple = {x=729, y=1013, z=6}  

if item.uid == 6388 then
    
    doPlayerSetTown(cid,2)
    doTeleportThing(cid,newtemple)
    doPlayerSendTextMessage(cid,22,"You are now citizen of Darfur.")
    
else
    doPlayerSendCancel(cid,"You are not allowed to live on Darfur.")
  
end

return 1

end

You only need to configure in the script the item UNIQUE ID (switch), the town id you want and the pos to spawn.
 
You can use regular teleporter for this as well, see if your distro has citizen script in movements and set action id to your teleporter.
 
I made one for for my town 2. it worked. How can i use same lever item id and use it in dif towns?
 
Last edited:
You can add actionid 30020 + townid to a teleport with id 1387. For example actionid 30022 for townid 2.
If you want it as an action script, you can do it the same way as the citizen.lua in movements, but then with function onUse.
 
Back
Top