How do I make it so the player who click a button. It find's that specific player in the workspace. I've tried several time's but failed
Firstly, this is not a request site. You need to at least put some effort into your code, and, assuming you are new, I would watch some tutorials before doing this; however, I will tell you what you need to do.
You need to use a ClickDetector inside of your button. What a ClickDetector does, it allows the use of certain events in a script that are called when a person clicks the part.
This is an example of what you could do. For this example, you need the parent of the ClickDetector
to be the part, as well as for the script.
local clicker = script.Parent.ClickDetector clicker.MouseClick:Connect(function(_player) end)
On line 0, we reference the ClickDetector
and assign it to the variable clicker
On line 2, we use the clicker's MouseClick
event, and connect an anonymous function to be called. What this means is that anything after _player) and before end) will be called when the part is clicked.
At this point you may be wondering how we get the player. When the event is called, it passes the parameter of the player who clicked to the _player
argument. You can do what you want with this.
If this solves your issue, do not forget to upvote and set this as the answer!