Here's my script:
local door1 = script.Parent local door2 = script.Parent.Parent.Door2 local doorknob1 = script.Parent.Parent.DoorKnob1 local doorknob2 = script.Parent.Parent.DoorKnob2 local Opensound = script.Parent.Parent.SoundPart.Open local Closesound = script.Parent.Parent.SoundPart.Close function Click() Opensound:Play() door1.Transparency = 1 door1.CanCollide = false doorknob1.Transparency = 1 doorknob1.CanCollide = false door2.Transparency = 0 door2.CanCollide = true doorknob2.Transparency = 0 doorknob2.CanCollide = true wait(1) Closesound:Play() door2.Transparency = 1 door2.CanCollide = false doorknob2.Transparency = 1 doorknob2.CanCollide = false door1.Transparency = 0 door1.CanCollide = true doorknob1.Transparency = 0 doorknob1.CanCollide = true end script.Parent.ClickDetector.MouseClick:Connect(Click)
And I have no idea how to make this door usable for teams only.
Write this:
local door1 = script.Parent local door2 = script.Parent.Parent.Door2 local doorknob1 = script.Parent.Parent.DoorKnob1 local doorknob2 = script.Parent.Parent.DoorKnob2 local Opensound = script.Parent.Parent.SoundPart.Open local Closesound = script.Parent.Parent.SoundPart.Close script.Parent.ClickDetector.MouseClick:Connect(function(player) if player.TeamColor == BrickColor.new("Really red") then --Change to the teamcolor you want to get access print("You get access") Opensound:Play() door1.Transparency = 1 door1.CanCollide = false doorknob1.Transparency = 1 doorknob1.CanCollide = false door2.Transparency = 0 door2.CanCollide = true doorknob2.Transparency = 0 doorknob2.CanCollide = true wait(1) Closesound:Play() door2.Transparency = 1 door2.CanCollide = false doorknob2.Transparency = 1 doorknob2.CanCollide = false door1.Transparency = 0 door1.CanCollide = true doorknob1.Transparency = 0 doorknob1.CanCollide = true else print("No access for you") end end)
Thank me later