How to fire a client from clicking a button?

So I am wondering how I can get the player when they click the player so I can fire the client when they click the part. But I don’t know how I can get the player. How can I get the player?

Here is my script so far:

script.Parent.ClickDetector.MouseClick:Connect(function(click)
	local remote1 = game:GetService("ReplicatedStorage").SecretDoor:FindFirstChild("Fade")
	remote1:FireClient()
end)

Thank you for your time!

Sincerely,

papahetfan

ClickDetectors send the player who clicked, in their parameters.

script.Parent.ClickDetector.MouseClick:Connect(function(click)
	local remote1 = game:GetService("ReplicatedStorage").SecretDoor:FindFirstChild("Fade")
	remote1:FireClient(click) -- 'click' is the player
end)
2 Likes

Thank you very much! I was just making sure because I always mess up with clicking a part lol.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.