I need some help to know whats wrong here. Im still learning LUA, thats why I got no idea of whats wrong.
I been trying to change it, so I have got different errors.
Thanks in advanced, rep+ for thelp
Lua:
local temple = {x=160, y=50, x=7}
local level = 50
function Onuse(cid, frompos, item, topos, item2)
if getPlayerLevel >= level then
doTeleportThing(cid,temple,TRUE)
doSendMagicEffect(fromPosition,math.random(1,60))
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Teleported")
doRemoveItem(uid,1)
elseif hasCondition(cid, CONDITION_INFIGHT) == TRUE then
doPlayerSendCancel(cid,"You mustnt be in a fight in order to travel!")
end
return true
end
I been trying to change it, so I have got different errors.
Code:
[10/11/2010 15:52:49] [Warning - Event::loadScript] Event onUse not found (data/actions/scripts/temple scroll.lua)
[10/11/2010 15:43:51] [Error - LuaScriptInterface::loadFile] data/actions/scripts/temple scroll.lua:5: 'end' expected (to close 'function' at line 4) near 'elseif'
[10/11/2010 15:43:51] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/temple scroll.lua)
[10/11/2010 15:43:51] data/actions/scripts/temple scroll.lua:5: 'end' expected (to close 'function' at line 4) near 'elseif'
Thanks in advanced, rep+ for thelp