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

How to Mess With Players Through A OnClick?

I will explain more, when someone clicks a block I want them to do an animation. I can handle the animation, but I have no idea how to get the script to navigate to the person that clicked on it to mess with their humanoid/inventory. How would I get the onClick to navigate there?

1 answer

If you're using a Click Detector, the event OnClick will give the player that clicked.

--// Example:
local part = script.Parent
local clickDetector = part:WaitForChild("ClickDetector")

clickDetector.MouseClick:Connect(function(plr)
	local character = plr.Character or plr.CharacterAdded:Wait()
end)

Another option would be using a Local Script and using the mouse. A lovely question explains more here.

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