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

Citizenship teleport help

Jfrye

Mapper, trying to learn scripting
Joined
Jan 8, 2009
Messages
365
Solutions
5
Reaction score
86
Location
Mexico Missouri
Hey everyone, Im looking for a little help with the citizenship teleport.

Im using tfs 1.1 and 10.77 client. Basically, I was trying to add in the script that says, "You are now a citizen of 'xxx' town."

Code:
function onStepIn(creature, item, position, fromPosition)
    if item.actionid > 30020 and item.actionid < 30050 then
        local player = creature:getPlayer()
        if player == nil then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are now a citizen of 'town'") 
            return false
        end

        local town = Town(item.actionid - 30020)
        player:setTown(town)
       
    end
    return true
end

The script works great, so there is no issue with the script. I just attempted to add the message in various locations and had no luck. I left the message in the code above, but I also tried placing it under player:setTown(town).

Neither place would show the message like I had hoped, and neither place caused any console errors. Im sure this is a simple fix, but Im just not seeing it.
 
Solution
try this?
I don't work with 1.1.. :c
Lua:
function onStepIn(creature, item, position, fromPosition)
    if item.actionid > 30020 and item.actionid < 30050 then
        local player = creature:getPlayer()
        if player == nil then
            return false
        end

        local town = Town(item.actionid - 30020)
        player:setTown(town)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are now a citizen of ".. getTownName(town) .. ".")
    end
    return true
end
try this?
I don't work with 1.1.. :c
Lua:
function onStepIn(creature, item, position, fromPosition)
    if item.actionid > 30020 and item.actionid < 30050 then
        local player = creature:getPlayer()
        if player == nil then
            return false
        end

        local town = Town(item.actionid - 30020)
        player:setTown(town)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are now a citizen of ".. getTownName(town) .. ".")
    end
    return true
end
 
Solution
Code:
local town = Town(x)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now a citizen of ' .. town:getName() .. '.')
 
Back
Top