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
9 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 ?

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)

1 answer

Log in to vote
3
Answered by 9 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:

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

Answer this question