TheTeamColor = "Bright red"
game.Players.ChildAdded:connect(function(player)
wait(15)
if player.TeamColor == TheTeamColor then
if player.Character:findFirstChild("ZAnimate") then
player.Character.Head.remove()
end
end
end)
COMMUNITY QUESTION
How can I make this script kill people who are in Bright red but have ZAnimate? [Unsolved!]
1 answer
There are several flaws in your code. Let me correct them.
TheTeamColor = BrickColor.new("Bright red")
game.Players.ChildAdded:connect(function(player)
wait(15)
if player.TeamColor == TheTeamColor then
if player.Character:FindFirstChild("ZAnimate") then
player.Character.Head:Destroy()
end
end
end)
You had the following errors:
- Using
"Bright red"instead ofBrickColor.new("Bright red")on line 1."Bright red"is a string, butplayer.TeamColoris aBrickColor. :findFirstChildinstead of:FindFirstChild. You just should not use:findFirstChildanymore..remove()First of all, you are telling to execute the player's head'sremove(), but you are not telling it what to remove. The fix to this is:remove(). Secondly, you should not use:remove()anymore. Use:Destroy()instead, it works better.
This discussion is preserved as it was. New answers, comments, and votes are closed.
