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 ?
01 | Door = script.Parent |
02 | ------------------------------------ |
03 | modelname = "Desert Military Team" |
04 | ------------------------------------ |
05 |
06 | function onTouched(hit) |
07 | print ( "Door Hit" ) |
08 | local human = hit.Parent:FindFirstChild( "Humanoid" ) |
09 | if (human ~ = nil ) then |
10 | if game.Players:playerFromCharacter(hit.Parent).TeamColor = = game.Teams:findFirstChild(modelname).TeamColor then |
11 | Door.CanCollide = false |
12 | Door.Transparency = 0.5 |
13 | wait( 2 ) |
14 | Door.CanCollide = true |
15 | Door.Transparency = 0 |
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:
1 | else -- TeamColor is not game.Teams:findFirstChild(modelname).TeamColor |
2 | human.Health = 0 -- Set the humanoids health to 0 |