Na Amigo
The crazy girl
i have door level script from 8.1 ot i have added it to 8.6 server
i got error while passing the door
here is the error
this my action code
and here is my script:-
i got error while passing the door
here is the error
Code:
[21/06/2017 06:33:40] [Error - Action Interface]
[21/06/2017 06:33:40] data/actions/scripts/New Doors.lua:onUse
[21/06/2017 06:33:40] Description:
[21/06/2017 06:33:40] data/actions/scripts/New Doors.lua:3: attempt to index global 'doorHandler' (a nil value)
[21/06/2017 06:33:40] stack traceback:
[21/06/2017 06:33:40] data/actions/scripts/New Doors.lua:3: in function 'NewDoors'
[21/06/2017 06:33:40] data/actions/scripts/New Doors.lua:32: in function <data/actions/scripts/New Doors.lua:29>
Code:
<action actionid="49000" event="script" value="New Doors.lua" />
<action actionid="49001" event="script" value="New Doors.lua" />
<action actionid="49002" event="script" value="New Doors.lua" />
<action actionid="49003" event="script" value="New Doors.lua" />
<action actionid="49004" event="script" value="New Doors.lua" />
<action actionid="49005" event="script" value="New Doors.lua" />
Code:
function NewDoors(cid, lvl, item, topos, frompos)
if getPlayerLevel(cid) >= lvl then
doorHandler:useDoor(item, topos, cid, nil, true)
playerpos = getPlayerPosition(cid)
doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}
if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then
doMoveCreature(cid, 1)
elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 2)
elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then
doMoveCreature(cid, 3)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 4)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then
doMoveCreature(cid, 5)
elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 6)
elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then
doMoveCreature(cid, 7)
end
else
doPlayerSendTextMessage(cid, 16, "you want level " .. lvl .. " to pass this door! .")
end
end
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 49000 then
NewDoors(cid, 1000, item, topos, frompos)
elseif item.actionid == 49001 then
NewDoors(cid, 2000, item, topos, frompos)
elseif item.actionid == 49002 then
NewDoors(cid, 5000, item, topos, frompos)
elseif item.actionid == 49003 then
NewDoors(cid, 10000, item, topos, frompos)
elseif item.actionid == 49004 then
NewDoors(cid, 25000, item, topos, frompos)
elseif item.actionid == 49005 then
NewDoors(cid, 60000, item, topos, frompos)
end
end