Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a button that says how many people clicked it?

I'm making a game and I'm making a reload map script but I can't figure out how to make a button that says how many people clicked it. Thanks!

3 comments

0

nice

0

a button gui wise or a model wise?

0

Buttons gui

1 answer

✓ Accepted answer

A way i found for this is you add a number value child into the text then make the text display the number value after you convert the number into text (I would have no idea what this means if i read it so here)

local NumberValue = Instance.new("NumberValue") --Create a NumberValue

NumberValue.Parent = script.Parent  --Make the parent of the newly created NumberValue the 
TextButton

script.Parent.Parent.TextButton.MouseButton1Click:Connect(function()

	script.Parent.NumberValue.Value = script.Parent.NumberValue.Value + 1 --Add 1 to the value to resemble a click

local Number = tostring(NumberValue.Value) --The NumberValue's Value being translated into text and Learn more about strings here: (https://developer.roblox.com/en-us/articles/String)

script.Parent.Text = Number --Changing the text into the values value
end)

2 comments

0

Thank you so much! This is the last script for my game!

0

Its no problem! Hope your game turns out nice!

This discussion is preserved as it was. New answers, comments, and votes are closed.