So, I have been creating a game to practice scripting in Roblox Studio. I ran into an issue… Again… And I need some help. You see, I want to make it so that when you click a GUI text button, it adds 1 to a number on a text label. I don’t know if this is even possible, but if so, please tell me what I need to do as I am stuck. Thank you!
I am not completely sure that I understand. You have to know I have never really scripted that much before. Is there anything else you could do to explain that process? Sorry!
-- LocalScript inside of the TextButton
local label = -- path to your TextLabel inside of your SurfaceGui
local number = 0
script.Parent.MouseButton1Click:Connect(function()
number += 1
label.Text = number
end)
Replace the comment to reference your TextLabel inside of your SurfaceGui