• 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 is wrong with this simple .LUA?

AleriaOT

New Member
Joined
Sep 5, 2013
Messages
35
Reaction score
0
HTML:
function ManaPercent()
        return math.ceil((Self.Mana()/Self.MaxMana()*100))
end
if ManaPercent() < 90 then
     alert()
end

Can you see something wrong in this?
 
Well the if statement is outside of the function, so that would probably be the issue. What are you trying to do? Perhaps something like this:

Code:
function ManaPercent()
if ManaPercent() < 90 then
    alert()
else
     return math.ceil((Self.Mana()/Self.MaxMana()*100))
end
end
 
Well the if statement is outside of the function, so that would probably be the issue. What are you trying to do? Perhaps something like this:

Code:
function ManaPercent()
if ManaPercent() < 90 then
    alert()
else
     return math.ceil((Self.Mana()/Self.MaxMana()*100))
end
end

He's using the if statement for the function.

@AleriaOT post the rest of the script and what the issue is.
 
Back
Top