Sir MoX
New Member
- Joined
- Jan 14, 2009
- Messages
- 285
- Reaction score
- 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPromotionLevel(cid) >= 1 then
if getCreaturePosition(cid).y < toPosition.y then
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
else
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
end
else
doPlayerSendCancel(cid, "You must be premium to pass this door.")
end
return TRUE
end
and here is the problem:
[04/01/2011 16:27:40] Lua Script Error: [Action Interface]
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua: onUse
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua:2: attempt to call global 'getPlayerPromotionLevel' (a nil value)
[04/01/2011 16:27:40] stack traceback:
[04/01/2011 16:27:40] [C]: in function 'getPlayerPromotionLevel'
[04/01/2011 16:27:40] data/actions/scripts/other/premiumdoor.lua:2: in function <data/actions/scripts/other/premiumdoor.lua:1>