door = script.Parent
local debounce = false
function onTouch(part)
if part.Parent == nil then return end
local name = part.Parent.Name
local user = game.Players:findFirstChild(name)
if user ~= nil then
if user.TeamColor == door.BrickColor and debounce == false then
debounce = true
door.Transparency = 0.5
wait(0.5)
door.Transparency = 1
door.CanCollide = false
wait(1)
door.Transparency = 0.5
wait(0.5)
door.Transparency = 0
door.CanCollide = true
debounce = false
end
end
end
door.Touched:connect(onTouch)
____________________________________________________________________________
Put this script in the brick of your choice. Now color the door as the same color as the team that the door is for, the EXACT color. Now only the allowed team can enter. Best!
PilotLuke |