• 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 Easy LUA help :P

Snach

Sensei
Joined
Aug 8, 2009
Messages
1,694
Reaction score
84
Location
Estonia
So I'm trying to learn LUA but I can't get a script working idk what is wrong
I have this script:

Lua:
function firstNumber()
local number = math.random(1,1)
return number
end
function secondNumber()
write("Type a number")
local number2 = read()
return number2
end
local numberone = firstNumber()
local numbertwo = secondNumber()
if numberone == numbertwo then
print("It works!")
else print("It doesn't work!")
end
it prints "it doesn't work" whatever number I type in.
also when I add
Lua:
print(numberone)
print(numbertwo)
to the end they are both printed correctly
idk what is wrong i spent so much time trying to fix it but no success :D it's probably smthing very easy so maybe someone can help. thx

edit:Apparently I was missing "tonumber" because read() returns a string
 
Last edited:
Back
Top