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

Solved Movements.lua sudden error

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
The script below used to work perfectly but now i'm not getting any msg action on the npc at location 836,940,7.

Code:
[30/08/2014 22:12:58] Lua Script Error: [MoveEvents Interface] 
[30/08/2014 22:12:58] data/movements/scripts/others/teleporter.lua:onStepIn

[30/08/2014 22:12:58] luaDoCreatureSay(). Creature not found

22:13 You see Nightmare Guard.
Position: [X: 836] [Y: 940] [Z: 7].
22:13 You see Nightmare Guard.
Position: [X: 839] [Y: 940] [Z: 7].

Code:
local pos = {x = 836, y = 940, z = 7, stackpos = 253}
local poss = {x = 839, y = 940, z = 7, stackpos = 253}
function onStepIn(cid, item, pos)

    if item.actionid == 30102 then
          queststatus = getPlayerStorageValue(cid,6580)
              if queststatus == -1 then
                doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You are not allowed to enter the nightmare knights castle.')
                doTeleportThing(cid,{x = 837, y = 942, z = 7})
                doCreatureSay(getThingfromPos(pos).uid, "Begone!", TALKTYPE_SAY)
                doCreatureSay(getThingfromPos(poss).uid, "Begone!", TALKTYPE_SAY)
            else
                    doCreatureSay(getThingfromPos(pos).uid, "Welcome!", TALKTYPE_SAY)
                    doCreatureSay(getThingfromPos(poss).uid, "Welcome!", TALKTYPE_SAY)
            end
    elseif item.actionid == 30103 then
          queststatus = getPlayerStorageValue(cid,6580)
              if queststatus == -1 then
                doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You are not allowed to enter the nightmare knights castle.')
                doTeleportThing(cid,{x = 838, y = 942, z = 7})
                doCreatureSay(getThingfromPos(pos).uid, "Begone!", TALKTYPE_SAY)
                doCreatureSay(getThingfromPos(poss).uid, "Begone!", TALKTYPE_SAY)
            else
                    doCreatureSay(getThingfromPos(pos).uid, "Welcome!", TALKTYPE_SAY)
                    doCreatureSay(getThingfromPos(poss).uid, "Welcome!", TALKTYPE_SAY)
            end
end

    return 1
end
 
Change the parameter names of the main function so it won't conflict.
Code:
function onStepIn(cid, item, position, fromPosition)
Or change local pos to local posx or something.
 
Back
Top