I am trying to change an IntValue on click (when you click a textButton). I also have a script that makes the IntValue be the text of the parent (textLabel). Here is the script on click,
upgrade = script.Parent.Parent.TextLabel.Upgrade -- these are IntValues in the textlabel number = script.Parent.Parent.TextLabel.Number script.Parent.MouseButton1Click:connect(function() number.Value = ""..number.Value + upgrade.Value end)
This is the script that makes the IntValue be the text.
while true do script.Parent.Parent.Text = ""..script.Parent.Value end
This is also another script that is in the upgrade (intValue) in the textLabel. It just makes sure if the person has the gamepass.
local pass = 182358984 -- this is a regular script where everything else is a local script local player = game.Players.LocalPlayer function Auth() return game:GetService('GamePassService'):PlayerHasPass(player.UserId, pass) end while true do if Auth() then script.Parent.Value = 3 else script.Parent.Value = 1 end end
The explorer looks like this, ScreenGui > TextButton > LocalScript In that screen Gui is also -- TextLabel > Upgrade > Script In that TextLabel is also -- Number > Script