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

How do i kill players who don't wear specific hat?

Asked by
Mokiros 135
10 years ago

I want to make space game, and i want to make script which will kill players if they don't wear space hat when they leave room.

Or script which instantly wear hat on spawned player.

1 answer

Log in to vote
0
Answered by 10 years ago

Kill instantly:

while true do
wait()
for i,v in ipairs(game.Players:GetChildren()) do
if v.Character then
if v.Character:FindFirstChild("HATNAME") == nil then
v.Character:BreakJoints()
end
end
end

Kill slowly:

while true do
wait()
for i,v in ipairs(game.Players:GetChildren()) do
if v.Character then
if v.Character:FindFirstChild("HATNAME") == nil then
v.Character.Humanoid.Health = v.Character.Humanoid.Health - 1
end
end
end

If this doesn't work then i'm sorry. I didn't test it

Ad

Answer this question