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

How to Get the Player who Activated an onClicked Function?

I tried this format but it doesn't even connect to the function? Any ideas?

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	print("connected")
end)

2 comments

0

The script is inside a part, or a GUI?

0

Part

1 answer

I hope this can help:

local function clicked(player)
print("Connected to".. player.Name)
end

script.Parent.ClickDetector.MouseClicked:Connect(clicked)

(Hasn't been tested)

1 comment

0

This didn't work. Not sure why. No error was shown in the output, but also no print.

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