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

How can I make a screen gui button it changes the text by +1?

Ive tried to add when clicked functions but it still does not work. Please help.

4 comments

0

you want a textbutton to add by one everytime a player clicks on it?

0

Yes I do for everyone that clicks on it.

0

so if one person clicks you want the whole server to get a + 1 on the text?

0

yes

1 answer

i think this is the simple example for you as a reference

local button = --Your Button
button.MouseButton1Click:Connect(function() --When the button was clicked
local x
local text = --Your Text
x = x+1
text.Text = x
end)

2 comments

0

Calling the text variable inside the MouseButton1Click is unnecessary. You can put it outside the event, There's a term called DRY (Don't Repeat Yourself).

0

This did not work.

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