I've created a script, when i type the word "tp" in a specific position i want to get teleported. but i get an error
My talkactions.xml:
My .lua script:
The error i recieve:
I don't understand why my variable is declared to a boolean variable... please help me!
My talkactions.xml:
XML:
<talkaction words="tp" script="custom/looktype-tp.lua"/>
My .lua script:
Lua:
local pos = getPlayerPosition(cid)
local newPos = {x=1000, y=1000, z=7}
function onSay(cid, words, param)
if pos.x == 1000 and pos.y == 1000 and pos.z == 7 then
doTeleportThing(cid, newPos)
doSendMagicEffect(getPlayerPosition(cid), 12)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to stand on the glowing switch!")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end
The error i recieve:
Code:
[04/11/2012 13:38:59] Lua Script Error: [TalkAction Interface]
[04/11/2012 13:38:59] data/talkactions/scripts/custom/looktype-tp.lua:onSay
[04/11/2012 13:38:59] data/talkactions/scripts/custom/looktype-tp.lua:5: attempt to index upvalue 'pos' (a boolean value)
[04/11/2012 13:39:00] stack traceback:
[04/11/2012 13:39:00] [C]: in function '__index'
[04/11/2012 13:39:00] data/talkactions/scripts/custom/looktype-tp.lua:5: in function <data/talkactions/scripts/custom/looktype-tp.lua:4>
I don't understand why my variable is declared to a boolean variable... please help me!