Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

0
you want a textbutton to add by one everytime a player clicks on it? AntoninFearless 622 — 3y
0
Yes I do for everyone that clicks on it. jackpanda900 26 — 3y
0
so if one person clicks you want the whole server to get a + 1 on the text? AntoninFearless 622 — 3y
0
yes jackpanda900 26 — 3y

Closed as Not Constructive by Dovydas1118 and imKirda

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 3 years ago

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)
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). Dovydas1118 1495 — 3y
0
This did not work. jackpanda900 26 — 3y
Ad