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

become citizen

leoxdnardo

The Player
Joined
Sep 6, 2010
Messages
16
Reaction score
1
Location
Brazil
Can someone tell me what is missing to work
Code:
local config = {
[30010] = {acid=30010, cityi=Survia, townidi=2, posi={x=615, y=1107, z=7}},
[30011] = {acid=30011, cityi=Dwarvia, townidi=3, posi={x=816, y=1189, z=11}},
[30012] = {acid=30012, cityi=Cadorvia, townidi=4, posi={x=947, y=1128, z=7}}
}

function onStepIn(cid, item, pos)

local t = config[item.aid]
    if item.actionid == t.acid then
        doPlayerSetTown(cid,t.townidi) 
		doTeleportThing(cid,t.posi)
        doSendMagicEffect(getCreaturePosition(cid),12)
		doPlayerSendTextMessage(cid,22, "You are now a citizen of .. t.cityi.")
		end
    return 1
end

lua:11 attempt to index local 't' (a nil value)
 
Last edited:
Lua:
local t = config[item.aid]
local config = {
[30010] = {acid=30010, cityi=Survia, townidi=2, posi={x=615, y=1107, z=7}},
[30011] = {acid=30011, cityi=Dwarvia, townidi=3, posi={x=816, y=1189, z=11}},
[30012] = {acid=30012, cityi=Cadorvia, townidi=4, posi={x=947, y=1128, z=7}}
}

function onStepIn(cid, item, pos)


    if item.actionid == t.acid then
        doPlayerSetTown(cid,t.townidi) 
		doTeleportThing(cid,t.posi)
        doSendMagicEffect(getCreaturePosition(cid),12)
		doPlayerSendTextMessage(cid,22, "You are now a citizen of ".. t.cityi.."")
		end
    return true
end
 
Your way didn't work...
I did this way and now it's working
Lua:
local config = {
[30010] = {acid=30010, townidi=2, posi={x=615, y=1107, z=7}, cityi="Survia"},
[30011] = {acid=30011, townidi=3, posi={x=816, y=1189, z=11}, cityi="Dwarvia"},
[30012] = {acid=30012, townidi=4, posi={x=947, y=1128, z=7}, cityi="Cadorvia"}
}
 
function onStepIn(cid, item, pos)
 
 local t = config[item.actionid]
    if item.actionid == t.acid then
        doPlayerSetTown(cid,t.townidi) 
		doTeleportThing(cid,t.posi)
        doSendMagicEffect(getCreaturePosition(cid),12)
		doPlayerSendTextMessage(cid,22, "You are now a citizen of " .. t.cityi .. ".")
		end
    return true
end
 
Back
Top