Yo i got this team door script when i touch it i don't die and i want the door to kill how to do it ?
Door = script.Parent ------------------------------------ modelname="Desert Military Team" ------------------------------------ function onTouched(hit) print("Door Hit") local human = hit.Parent:FindFirstChild("Humanoid") if (human ~= nil ) then if game.Players:playerFromCharacter(hit.Parent).TeamColor==game.Teams:findFirstChild(modelname).TeamColor then Door.CanCollide = false Door.Transparency = 0.5 wait(2) Door.CanCollide = true Door.Transparency = 0 print("Human touched door") end end end connection = Door.Touched:connect(onTouched)
You mistype the method GetPlayerFromCharacter()
at line 10
Source: http://wiki.roblox.com/index.php?title=GetPlayerFromCharacter_%28Method%29
And if you want to kill the players that are not in that team then at line 17 paste:
else -- TeamColor is not game.Teams:findFirstChild(modelname).TeamColor human.Health = 0 -- Set the humanoids health to 0