Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ClickDetector script. Help?

Asked by 10 years ago

I am testing it on Edit mode, so my name is Player1. I do know that.

What this script should do is check if the player name is Player1 or Player2. But it doesn't seem to be working.

Also, there is no errors ;/ It will always print No.

Help? Thanks. :)

you ={"Player1","Player2"}

function onClick(click)
        if click.Parent.Name == you then 
        print ("hai'")
        else
        print("No.") 
        end 
end

script.Parent.ClickDetector.MouseClick:connect(onClick)

Answer this question