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

ERROR with citizen.lua script

aleixbcn90

New Member
Joined
Dec 18, 2010
Messages
6
Reaction score
0
The error is:

[04/01/2011 02:20:21] Lua Script Error: [MoveEvents Interface]
[04/01/2011 02:20:21] data/movements/scripts/citizen.lua:eek:nStepIn
[04/01/2011 02:20:21] data/movements/scripts/citizen.lua:5: attempt to call global 'getTownName' (a nil value)
[04/01/2011 02:20:21] stack traceback:
[04/01/2011 02:20:21] [C]: in function 'getTownName'
[04/01/2011 02:20:21] data/movements/scripts/citizen.lua:5: in function <data/movements/scripts/citizen.lua:1>

While i'm using TFS 0.2.9.0 with scripts on movement:
movement.xml
PHP:
	<!-- Citizen teleport --> 
        <movevent event="StepIn" itemid="1387" script="citizen.lua"/>

and for citizen.xml

PHP:
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 the newest resident of " .. getTownName(townId) .. ".") 
    end 

    return true 
end

PLZ HELP ME!!
 
That's a low version of TFS o_O
Well, this is the 8.54 Crying Damson one, 0.3.6.
they're completely identical. o_O
Lua:
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 the newest resident of " .. getTownName(townId) .. ".")
	end

	return true
end

use lua code tags
Lua:
[.lua][./lua]
 
Anyway, i have 0.2.9 coz it's the Talaturen's 8.7 client server, i don't know if i have to update other versions (such 0.3.x) with files i have or... coz it still doesn't work u.u'
 
Back
Top