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

Lua what does this error mean?

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
HTML:
[08/01/2012 00:10:07] [Error - LuaScriptInterface::loadFile] data/globalevents/scripts/regeneration.lua:73: 'end' expected (to close 'function' at line 1) near '<eof>'
[08/01/2012 00:10:07] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/regeneration.lua)
[08/01/2012 00:10:07] data/globalevents/scripts/regeneration.lua:73: 'end' expected (to close 'function' at line 1) near '<eof>'
 
there is like 5 ends lol

Code:
function onThink(interval, lastExecution, thinkInterval)
	local players = getPlayersOnline()
 
	for _, x in pairs(players) do
	
			if isNone(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 1 + getPlayerMagLevel(x) * 1))
				end
				
			if isSorcerer(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 3 + getPlayerMagLevel(x) * 3))
				end
				
			elseif isDruid(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 3 + getPlayerMagLevel(x) * 3))
				end
				
			elseif isPaladin(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 1.5 + getPlayerMagLevel(x) * 3))
				end
				
			elseif isKnight(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 0.5 + getPlayerMagLevel(x) * 10))
				end
				
			elseif isMasterSorcerer(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 4 + getPlayerMagLevel(x) * 4))
				end
				
			elseif isElderDruid(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 4 + getPlayerMagLevel(x) * 4))
				end
				
			elseif isRoyalPaladin(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 2 + getPlayerMagLevel(x) * 4))
				end
				
			elseif isEliteKnight(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) + getPlayerMagLevel(x) * 2))
				end
				
			elseif isWizard(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 5 + getPlayerMagLevel(x) * 5))
				end
				
			elseif isShaman(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 5 + getPlayerMagLevel(x) * 5))
				end
				
			elseif isArcher(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) * 2.5 + getPlayerMagLevel(x) * 4.5))
				end
				
			elseif isWarrior(x) then
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, (getPlayerLevel(x) + getPlayerMagLevel(x) * 2.5))
			end
		end
	end
	return true
end
 
Back
Top