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

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

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!".

4 comments

0

Did you try any code?

0

Is this button a GUI or world object?

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

0

Try using the :GetPlayerFromCharacter function.

1 answer

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)

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