How to find PlayerScripts with ClickDetector?

Thank you , didn’t know it was a thing

I have multiple of them, so would I just duplicate the script over and over?

Do you have multiple parts like this one?

If so, you could store them all in a table and loop through them , make sure each of them has click detector, but you could use 1 script to make all of them work

No, just iterate over every ClickDetector instance and hook each’s “MouseClick” RBXScriptSignal object to the same function.

local function onClicked(player)
	local playerScripts = player:WaitForChild"PlayerScripts"
end

for _, clickDetector in ipairs(workspace:GetDescendants()) do
	if clickDetector:IsA"ClickDetector" then
		clickDetector.MouseClick:Connect(onClicked)
	end
end