This door is meant to allow people within a team to go through, but nobody else.
local Debounce = false script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and Debounce == false then Debounce = true local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr.Team == game.Teams.Police then script.Parent.CanCollide = false wait(5) script.Parent.CanCollide = true Debounce = false end end end)
Use Collision Filtering through PhysicsService. This allows certain parts to collide in a different way than other parts (ie. the parts in a player's character and a team's door)
A helpful Roblox article can be found here that deals with team doors.
I got this from a game that I was working on and I think this may solve your question
debounce = false script.Parent.Touched:connect(function(hit) if (hit) then if (hit.Parent) then a = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) if (a) then if (a.TeamColor == BrickColor.new("Really blue")) then debounce = true script.Parent.Transparency = 0.5 script.Parent.CanCollide = false wait(1) script.Parent.Transparency = 0 script.Parent.CanCollide = true debounce = false end end end end end)