If you have a button with a CLickDetector, and you only want rank+ or team only, or something to use it, how do I find the player from the click to check if the person is rank+, team, etc?
I know I need something like this...
script.Parent.ClickDetector.MouseClick:connect(function()
--*something to find the player*
if Player.TeamColor == BrickColor.new("Really red") then
script.Parent:Remove()
end
end)

9 comments
Well. I tried something like that before, and I did print(Player) and it gave me a number.
What kind of script is this in? Also, you should try: print(Player.Name)
It was a while ago, so I might of done .Name, but I don't know. Thanks for the help though! And it's in a ServerScript.
Verifying the player would be excessive. It's best to just add the "Player" argument and leave it at that.
I'm sure just printing (Player) prints the ID of the Player Object relative to your game, I might be wrong, and no problem.
@Redbullusa, Its not that excessive, its just adding one if statement, and barely a second more of processing power.
Well, thanks though for the help!
No need to check for the Player to exist. Also, printing objects works fine normally.
Ah, I was thinking it worked like Java, where if you just do print(Object) it printed the specific Object's ID.