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

Solved Citizen Teleport (help)

D_Evans89

Member
Joined
Dec 3, 2014
Messages
175
Reaction score
12
I need help.

I'm using The Forgotten Server - Version 0.2.13 (Mystic Spirit)

citizen.lua

Code:
function onStepIn(cid, item, position, fromPosition)
    if(item.actionid > 30020 and item.actionid < 30100) then
        doPlayerSetTown(cid, item.actionid - 30020)
    end
    return TRUE
end

movements.xml

Code:
    <movevent event="StepIn" itemid="5023" script="citizen.lua"/>

Actionid for portal is set to 30021

Problem: When I walk into the portal it doesn't do anything. I stand on it as if it were a regular tile.
 
Add this between if and end (not the end under return TRUE).
Code:
doTeleportThing(cid, getTownTemplePosition(item.actionid - 30020))
 
You can use the function getTownName(townId) to get the name of the town.
Code:
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a citizen of "..getTownName(item.actionid - 30020)..".")
 
You should create your own Support/Requsts threads instead of bumping 4 years old thread.
 
1.2 anyone?
movements
XML:
<movevent event="StepIn" itemid="1387" script="citizen.lua" />
Lua:
function onStepIn(creature, item, position, fromPosition)
    if item.actionid > actionIds.citizenship and item.actionid < actionIds.citizenshipLast then
        if not creature:isPlayer() then
            return false
        end
        creature:setTown(Town(item.actionid - actionIds.citizenship))
    end
    return true
end
data/lib/core/actionids --> add into the actionids table
Lua:
citizenship = 30020, -- citizenship teleport
citizenshipLast = 30050, -- citizenship teleport last
 
Im sorry but I don't understand the script. Could you explain it to me?

What I currently have is five cities, and in each city temple there is a teleport in which the player must go in, set the corresponding town and get teleported to the city temple.
 
Im sorry but I don't understand the script. Could you explain it to me?

What I currently have is five cities, and in each city temple there is a teleport in which the player must go in, set the corresponding town and get teleported to the city temple.
for town 1, put actionid 30021
for town 2, put action 30022
 
Back
Top