i want to know how to so i can expand on that and try different things
When they spawn check that they are wearing the offending hat (with character:WaitForChild(hatName, 3)
, including the 3s timeout) and if the result is not nil call kick on their player.
PS: Don't kick me because of my head :(
In a server script placed in StarterCharacterScripts write the folllowing.
1 | local hat = "hat name" |
2 | if script.Parent:FindFirstChild(hat) then |
3 | local plr = game.Players:GetPlayerFromCharacter(script.Parent) |
4 | plr:Kick( "You were kicked for wearing " .. hat) |
5 | end |
If the player is not wearing the hat it will say it cant find it.