• 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 Got a problem with Lua

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 :p just testing after all :p

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
Just I am not sure what the error is :(

Sorry for being kinda noob.
 
Back
Top