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

Team door doesnt kill?

Asked by
Bulvyte 388 Moderation Voter
10 years ago

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 ?

01Door = script.Parent
02------------------------------------
03modelname="Desert Military Team"
04------------------------------------
05 
06function 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
View all 23 lines...

1 answer

Log in to vote
3
Answered by 10 years ago

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:

1else -- TeamColor is not game.Teams:findFirstChild(modelname).TeamColor
2    human.Health = 0 -- Set the humanoids health to 0
0
thank you Bulvyte 388 — 10y
Ad

Answer this question