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

how do i make a script which kicks someone wearing a specific hat?

Asked by 7 years ago

i want to know how to so i can expand on that and try different things

0
Thats just so mean I like my hat. User#5423 17 — 7y

2 answers

Log in to vote
2
Answered by 7 years ago

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 :(

Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

In a server script placed in StarterCharacterScripts write the folllowing.

local hat = "hat name"
if script.Parent:FindFirstChild(hat) then
    local plr = game.Players:GetPlayerFromCharacter(script.Parent)
    plr:Kick("You were kicked for wearing ".. hat)
end


If the player is not wearing the hat it will say it cant find it.

0
He said kicks someone, not destroys the hat. General_Scripter 425 — 7y
0
Oh sorry AuthenticOakChair 68 — 7y
0
Fixed AuthenticOakChair 68 — 7y

Answer this question