Filipalla helped me test my game but he found an error and not sure how to fix it.
1 | script.Value.Changed:connect( function () |
2 | if script.Value.Value > 100 then |
3 | script.Value.Value = 100 |
4 | end |
5 | end ) |
6 | while true do |
7 | wait( 0.05 ) |
8 | game.Players.LocalPlayer.PlayerGui.ScreenGui.MTC.Text = script.Value.Value |
9 | end |
Why do you have script.Value? there is not a value property of the script.
If you have a variable named 'script', change it because you cannot use key words as variable names.
I also notice you used the Changed event on an property, instead of the instance.
01 | local value = game.Workspace.Value -- where ever the value is |
02 |
03 | value.Changed:connect( function () -- not value.Value.Changed |
04 | if value.Value > 100 then |
05 | value.Value = 100 |
06 | end |
07 | end ) |
08 |
09 | while true do |
10 | wait( 0.05 ) |
11 | game.Players.LocalPlayer.ScreenGui.MTC.Text = tostring (value.Value) |
12 | end |
Also make sure you're running this in a local script.
"script.Value.Value"
Something is wrong here, you can have a value of a value