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

Make a part that only kills a certain team?

Asked by 9 years ago

you know that moment when you've stayed up until 5:30am building, and scripting, and you just start to forget things? Yeah, that happens to me alot. How do I do this again?

I wrote this, but it by no means works.

print 'Kill Shield Activated...'



function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if  h ~= nil then
local Player = game.Players:GetPlayerFromCharacter(h)
if Player.TeamColor == BrickColor.new("Camo") then
    Player.Character.Humanoid.Health = 0 


end

end 
end
script.Parent.Touched:connect(onTouched)

Answer this question