Hello, I stopped attempting to learn roblox lua about three months ago, how ever I am getting back into it, and have been going over the basics. But, I don't understand what is wrong with the script. I am just trying to practice right now but I am having trouble, help + what I did wrong would be greatly appreciated!! Thanks.
thevariable= 5
thewrongnumber= 7
wait (5)
if thewrongnumber == 6 then
hello()
else if
thevariable == 5
then hello()
end
function hello()
game.Workspace.Test.BrickColor = BrickColor.new("Black")
wait(5)
game.Workspace.Test.BrickColor = BrickColor.new("Purple")
return
end

3 comments
1.) Get rid of the odd spacing, and correctly indent your code (elseif no space and wait() no space. Also, variable declarations look better if there is a space between the variable and the = sign example: local x = true). 2.) Define your variables with local (example: local thevariable). 3.) Define your function before calling it and define it with local as well(example: local function hello()).
4.) Don't use return if it serves no purpose. You are not returning a value and the function ends by default at that point anyway. 5.) Use variables effectively for efficiency and ease. You say game.Workspace.Test twice. That is bad enough. Imagine if you had to type it more times. So, create a varaible for test.
Thanks, I will take your advice :D