• 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]Error in script dont know how to solve it.

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
i have an error in script maybe someone can help me solve it?

Lua:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/citizen.lua:onStepIn

data/movements/scripts/citizen.lua:18: attempt to compare number with nil
stack traceback:
        data/movements/scripts/citizen.lua:18: in function <data/movements/scrip
ts/citizen.lua:17>

thats the script:
Lua:
  local towns = {
        "Venore",
        "Edron",
        "Carlin",
        "Ab dendriel",
        "Kazordoon",
        "Thais",
        "Darashia",
        "Port Hope",
        "Svargrond",
        "Ankrahmun",
        "Liberty Bay",
        "Donate Island",
        "Azeroth"
}

function onStepIn(cid, item, position, fromPosition)
        if item.uniqueid > 8000 and item.uniqueid < 8100 then
                local newTown = item.uniqueid - 8000
                doPlayerSetTown(cid, newTown)
                doSendAnimatedText(getCreaturePosition(cid, 'You became citizen of a ' .. towns[newTown], TEXTCOLOR_GOLD))
        end
        return TRUE
end
 
Last edited:
ok i changed & then my server crashed after i go to TP...

check this
2mmec5j.png
 
FIXED !! , for those who might need it
Lua:
  local towns = {
        "Venore",
        "Edron",
        "Carlin",
        "Ab dendriel",
        "Kazordoon",
        "Thais",
        "Darashia",
        "Port Hope",
        "Svargrond",
        "Ankrahmun",
        "Liberty Bay",
        "Donate Island",
        "Azeroth"
}

function onStepIn(cid, item, position, fromPosition)
        if  item.uid > 8000 and  item.uid < 8100 then
                local newTown =  item.uid - 8000
                doPlayerSetTown(cid, newTown)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'You became citizen of a ' .. towns[newTown] .. '.')
        end
        return TRUE
end
 
Last edited:
FIXED !! , for those who might need it
Lua:
  local towns = {
        "Venore",
        "Edron",
        "Carlin",
        "Ab dendriel",
        "Kazordoon",
        "Thais",
        "Darashia",
        "Port Hope",
        "Svargrond",
        "Ankrahmun",
        "Liberty Bay",
        "Donate Island",
        "Azeroth"
}

function onStepIn(cid, item, position, fromPosition)
        if  item.uid > 8000 and  item.uid < 8100 then
                local newTown =  item.uid - 8000
                doPlayerSetTown(cid, newTown)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,'You became citizen of a ' .. towns[newTown] .. '.')
        end
        return TRUE
end

Thanks a lot :thumbup:
 
Back
Top