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

Lua Need help with script

George Dunaway

New Member
Joined
Jun 1, 2010
Messages
16
Reaction score
0
Hi,

I have script no want to work, could someone fix it?
I would add is that this is the script from the 0.2 engine mystic spirit, and now I am using 0.3.6 crying damson.

Script have the error:
Code:
[Error - TalkAction Interface]
data/talkactions/scripts/tp.lua:onSay
Description:
data/talkactions/scripts/tp.lua:5: attempt to call global 'comparePos' (a nil value)
stack traceback:
        data/talkactions/scripts/tp.lua:5: in function <data/talkactions/scripts/tp.lua:4>

Script:
Code:
local standPos = {x=848,y=695,z=7}
local newPos = {x=671,y=868,z=8}
 
function onSay(cid, param)
    if comparePos(getPlayerPosition(cid), standPos) then
        doSendMagicEffect(getPlayerPosition(cid), 2)
        doTeleportThing(cid, newPos)
        doSendMagicEffect(newPos, 10)
    end
    return 1
end
 
its doComparePositions not comparePos:
Code:
function doComparePositions(position, positionEx)
	return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z
end
 
Back
Top