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
you cant call a function, if it wasnt made yet. so you have to change some stuff
local thevariable= 5 local thewrongnumber= 7 local function hello() game.Workspace.Test.BrickColor = BrickColor.new("Black") wait(5) game.Workspace.Test.BrickColor = BrickColor.new("Purple") end if thewrongnumber == 6 then hello() else if thevariable == 5 then hello() end
sooo there were a lot of other problems and the one that u hav to fix is spacing, your script gotta be clean, im not sure if its something with your ctrl+c and ctrl+v but if youre working like that in a real script, you gotta fix this my dude. AND NEVER, I REPEAT, NEVER DO A WAIT AT THE TOP OF A SCRIPT.