ech
You do not look at the errors you have in the console?!?!
function onStepIn(cid, item, position, fromPosition)
if(item.actionid > 50020 and item.actionid < 50100) then
local townId = (item.actionid - 50020)
doPlayerSetTown(cid, townId)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest resident of " .. getTownName(townId) .. ".")
end
return true
end
local cfg = {
aid = 59906 -- action id of the teleport
}
if item.actionid == cfg.aid then
if isPlayer(cid) then
if not doPlayerRemoveItem(cid, 2148, 1) then
doTeleportThing(cid, fromPosition, true)
end
end
end
[21:42:39.560] [Error - MoveEvents Interface]
[21:42:39.560] data/movements/scripts/citizen.lua
[21:42:39.560] Description:
[21:42:39.560] data/movements/scripts/citizen.lua:13: attempt to index global 'item' (a nil value)
[21:42:39.560] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/citizen.lua)
local c = {
tpt = {x=1508, y=1575, z=7}, -- position where tp tp player
tpItem = 2491 -- here item id numer
}
function onStepIn(cid, item, position, fromPosition)
if(not isPlayer(cid)) then return false end
if getPlayerItemCount(cid, c.tpItem) >= 1 then
doPlayerRemoveItem(cid, c.tpItem, 1)
doTeleportThing(cid, c.tpt, false)
doSendMagicEffect(c.tpt, CONST_ME_TELEPORT)
else
addEvent(doTeleportThing, 1, cid, fromPosition)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have a "..getItemNameById(c.tpItem).." in order to pass.")
end
return true
end
<movevent type="StepIn" actionid="59906" event="script" value="[COLOR="#FF0000"]scriptname.lua[/COLOR]"/>
print("Testing if this part of script was loaded.")