Hey.
I’m making a city game, and there’d be a gate where only certain teams can pass, and the teams that cannot pass cannot go through. I made a localscript that does it, but it only works for 1 team, if I put multiple, it would make it pass for all teams, which I don’t want.
local player = game.Players.LocalPlayer
local teams = game:GetService("Teams")
local door = game.Workspace.Gate
while true do
if player.Team == teams.Civilian or teams.Leader or teams.Admission then
door.CanCollide = false
else
door.CanCollide = true
end
wait(0.1)
end
The localscript is in PlayerScripts, because it only worked there for some reason.
