local other = script.Parent.Parent.TextButton local CurrentOther= script.Parent.Parent.TextButton.Value.Value -- this is an int Value script.Parent.MouseButton1Click:Connect(function() wait(23) other.Text = other.Text - 2344 if CurrentOther.Value < 0 then CurrentOther.Value = 0 other.Text = 0 end 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:
local players = game:GetService("Players") 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:
"if CurrentOther.Value"
Make sure you change it to just:
"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.