In my game, I have a screen GUI with a frame, TextButton.
How would I make it that when the player presses the screen GUI, it changes a value?
Thank you!
This will need to be in a script inside of the button. You can modify the script.Parent
path as needed if your script is elsewhere.
script.Parent.MouseButton1Click:connect(function() game.Workspace.ExampleValue.Value = 1 -- replace with needed path end)
Scripting Helpers is not a request site
But I can give you some help
local textButton = -- TextButton location here. Or just script.Parent if the script is inside of the button textButton.MouseButton1Down:connect(function() -- Connect the function --Here you just have the value change, example: game.Workspace.NumberOfClicks = 19 end
Of course you would add a lot more lines to fit your liking, but you get the point.
script.Parent.MouseButton1Click:connect(function() game.Workspace.TheValue.Value = 0 -- Change "0" to what you want the value to equal end)