Hey there, I am trying to create a Roblox game for some experience, and it’s mostly about effecting GUI with code, as well as adding numbers to variables, etc.
I have made this script:
local tax = 10 local taxed = false local balance = 0 local guitext = game.StarterGui.Cash.TextBox function taxed() if balance > 0 then wait(60) balance = balance - tax taxed = true wait(5) taxed = false end end function money() wait(10) balance = balance + 10 end function changegui() if balance >= 0 then guitext.Text = "CASH: " + string(balance) else guitext.Text = "CASH: 0" end end while true do changegui() money() taxed() end
And it does not seem to be working. I was thinking it could be the while true loop, but if it isn’t, why isn’t my code effecting anything in my game? I’ve looked at tutorials to attempt to effect the GUI, but it doesn’t seem to be working.
I’ve been thinking that my code might be pseudo code, but I am not getting any errors in the editor.
I just need someone to point out the problem and help me out a little, thanks!