Could you maybe get the player from the Click and check the name? I am unsure of this... Here is what I tried. I tried to use click like you would use a hit on the touched event.
function click(click) if click.Parent.Name == "doctorbenny2011" then print("Test Passed") else print("Test Failed") end end script.Parent.ClickDetector.MouseClick:connect(click)
Should be:
function click(click) if click.Name == "Player" or click.Name=="doctorbenny2011" then -- click is the player that clicks the `ClickDetector` print("Test Passed") -- successfully prints `Test Passed` else print("Test Failed") end end script.Parent.ClickDetector.MouseClick:connect(click)
click
gains access to the player
, if we place click.Parent
that will lead us to Players
container.