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

How do i make the output show who clicked a button? [closed]

Asked by 4 years ago

I am doing a game with my friends and part of it needs to know who pressed a button first. I don't need it on any fancy GUI or anything like that, I just want to know how you can make it so when someone clicks, the output states "(USERNAME) has clicked the button!".

0
Did you try any code? op_roblox2009 11 — 4y
0
Is this button a GUI or world object? Paragolism 0 — 4y
0
Do your own research before asking questions. There are hundreds of sources explaining this topic and even free code on the docs. Not only that, but this isn't a request site, you need to either try some code yourself, or make it clear you are asking for clarification on a complex topic. The site rules are here: https://scriptinghelpers.org/help/community-guidelines SteamG00B 1633 — 4y
0
Try using the :GetPlayerFromCharacter function. 3F1VE 257 — 4y

Closed as Not Constructive by WideSteal321, SteamG00B, and JesseSong

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 4 years ago

If it's a world object, insert a click detector into it. The first parameter of a click detector on function is the player that clicked the object.

ClickDetector.MouseClick:Connect(function(plr)
print(plr.Name.." has clicked the button!")
end)
Ad