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

Problem with an event on my OT!! check it!!

Wezza

lua nOOb
Joined
May 31, 2008
Messages
2,278
Reaction score
31
The error in console:
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/event_items/games/forge.lua)
data/actions/scripts/event_items/games/forge.lua:109: 'end' expected (to close 'function' at line 86) near 'else'

The script:

function onUse(cid, item, fromPosition, itemEx, toPosition) <--- this is line 86
local altarPos = {x=810,y=699,z=9}
local firePos = {x=808,y=699,z=9}
local altar = getTileItemById(altarPos, 8305)
local standPos = {x=812,y=699,z=9}
local forge = math.random(1, 5)
local stuff = {fromPosition = fromPosition, toPosition = toPosition, cid = cid, altarPos = altarPos, standPos = standPos, counter = 0, firePos = firePos}

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The machine is examining the nitroglycerin. If the forging suceed you will obtain a bomb in a few seconds.")
addEvent(move, 5000, stuff)
else <--- this is line 109
warnPlayer(cid, "Please put a clod of nitroglycerine on the altar.")
end


Thanks in advance, and keep in mind im not posting the whole script, and I posted the error and a part from the script.
 
LUA:
else <--- this is line 109
doPlayerSendTextMessage(cid, 27,"Please put a clod of nitroglycerine on the altar.")

well, the point is in 0.3.6 and 0.2 dont have warn function mayby you created it self but this is only wheres looking bad.
 
Looks like you are putting an else to a function, which is wrong.
Check if theres an if above, which you can use the else with
 
Back
Top