01 | local other = script.Parent.Parent.TextButton |
02 | local CurrentOther = script.Parent.Parent.TextButton.Value.Value -- this is an int Value |
03 | script.Parent.MouseButton 1 Click:Connect( function () |
04 | wait( 23 ) |
05 | other.Text = other.Text - 2344 |
06 | if CurrentOther.Value < 0 then |
07 | CurrentOther.Value = 0 |
08 | other.Text = 0 |
09 | end |
10 | end ) |
and this is the error 10:38:59.149 - Players.helleric.PlayerGui.ssa.asd.LocalScript:5: attempt to -index upvalue 'CurrentOther' (a number value)
Try this instead:
1 | local players = game:GetService( "Players" ) |
2 | local CurrentOther = players.LocalPlayer.PlayerGui.GUI.TextButton:FindFirstChild( 'Value' ).Value |
Make sure you put the name of the "GUI", and the correct location of the "TextButton".
Also on line #6 where it says:
1 | "if CurrentOther.Value" |
Make sure you change it to just:
1 | "If CurrentOther" |
because you already got the value of the IntValue when you created the variable, "CurrentOther".
I think it should be local CurrentOther= script.Parent.Parent.TextButton.Value
And PLEASE don't name your value instances "Value" because it will create an enormous amount of confusion.