Hatsune Miku
Intermediate OT User
- Joined
- Jan 22, 2009
- Messages
- 370
- Reaction score
- 139
So I'm trying to learn lua and tried my first one.. its a basic talkaction script that should teleport you to temple if you say !temple on
1002, 1000, 7
2 steps away from my temple lol just testing after all
I don't understand what I did wrong
The error:
So the error is here
Just I am not sure what the error is
Sorry for being kinda noob.
1002, 1000, 7
2 steps away from my temple lol just testing after all
I don't understand what I did wrong
Lua:
function onSay(cid, words, slot)
local x = 1002
local y = 1000
local z = 7
if (getPlayerPosition(cid) == (x,y,z)) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSendTextMessage(cid, 4, "You have been teleported to temple!")
doSendMagicEffect(getPlayerPosition(cid), 31)
end
end
The error:
Code:
[12/06/2013 17:53:15] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tp test.lua:6: ')' expected near ','
[12/06/2013 17:53:15] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tp test.lua)
[12/06/2013 17:53:15] data/talkactions/scripts/tp test.lua:6: ')' expected near ','
[12/06/2013 17:53:15] Reloaded talk actions.
So the error is here
Lua:
if (getPlayerPosition(cid) == (x,y,z)) then
Sorry for being kinda noob.