I need some help with magic rope script it isn't working and in my console it is spamming this error.
30/12/2008 19:43:59] data/spells/scripts/support/magic rope.lua:6: attempt to call global 'getThingfromPos' (a nil value)
[30/12/2008 19:43:59] stack traceback:
[30/12/2008 19:43:59] data/spells/scripts/support/magic rope.lua:6: in function <data/spells/scripts/support/magic rope.lua:3>
here is my script:
local ArrayRopeSpot = {384, 418, 8278}
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
pos.stackpos = 0
local grounditem = getThingfromPos(pos)
if(isInArray(ArrayRopeSpot, grounditem.itemid) == TRUE) then
local newpos = pos
newpos.y = newpos.y + 1
newpos.z = newpos.z - 1
doTeleportThing(cid, newpos, 0)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
return LUA_NO_ERROR
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end
end
30/12/2008 19:43:59] data/spells/scripts/support/magic rope.lua:6: attempt to call global 'getThingfromPos' (a nil value)
[30/12/2008 19:43:59] stack traceback:
[30/12/2008 19:43:59] data/spells/scripts/support/magic rope.lua:6: in function <data/spells/scripts/support/magic rope.lua:3>
here is my script:
local ArrayRopeSpot = {384, 418, 8278}
function onCastSpell(cid, var)
local pos = getPlayerPosition(cid)
pos.stackpos = 0
local grounditem = getThingfromPos(pos)
if(isInArray(ArrayRopeSpot, grounditem.itemid) == TRUE) then
local newpos = pos
newpos.y = newpos.y + 1
newpos.z = newpos.z - 1
doTeleportThing(cid, newpos, 0)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
return LUA_NO_ERROR
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(pos, CONST_ME_POFF)
return LUA_ERROR
end
end