How do I make team only door

So I have 4 teams in total;

  • Trainers (“Plum”)
  • Trainees (“White”)
  • Team A (“Gold”)
  • Team B (“Bright bluish green”)

I want Team A and Trainers only can go past through the door and others can’t get inside. Can anyone help me?

2 Likes
2 Likes

Simple way:
Local script:

local player = game.Players.LocalPlayer
local teams = game:GetService("teams")
local door = game.Workspace:FindFirstChild("Door")
if player.Team == teams.Trainer or teams["Team A"] then
    door.CanCollide = false
end

Recommend to try what @nicemike40 said because this can be easily exploited due to being client sided

2 Likes