So, Ive made many questions about this topic but I still don't understand. I have made a script myself to test it out a little bit. This is what I made.
1 | local Temp = game.Workspace.Temp.Value |
2 |
3 | while true do |
4 | wait( 2 ) |
5 | Temp = Temp + 1 |
6 | end |
But It doens't seem to work. What I want to do is make it add +1 to the NumberValue called "Temp" every 2 seconds. Anyone knows what is wrong?
Best Regards, kyanoke11
You are adding 1 to the variable Temp not the NumberValue object's value. When you do
1 | local Temp = game.Workspace.Temp.Value |
It sets Temp to the NumberValue's value. Then you are adding 1 to the Temp variable with your loop.
What you need to do is this
1 | local Temp = game.Workspace.Temp |
2 |
3 | while true do |
4 | wait( 2 ) |
5 | Temp.Value = Temp.Value + 1 |
6 | end |