I've been trying several methods but they seem not to be working, the door only opens for the Maroon team, and not the Bright red team. Whatever is listed first will open the door for that specific team. But in this case, I want more than one team to walk through the door instead of just one team. Responses are appreciated. [The AntiHack and fancy stuff is not necessary, a simple script would do just fine too.]
TeamColor="Maroon" --the team color allowed though
Time=2 -- time to keep door opened
AntiHack=1 --This is the mode it will do to intruders who touch the door 0= mostly nothing if they sneak, 1= pushes em back and sits em ^_^, 2=Kills em on touch....
ColorDoor=false --whether it colors the door the team color you disignated
----------------------------------------code------------------------------------------------------------------------------
Color=BrickColor.new(TeamColor)
on=false
s=script.Parent
ss=script.Parent:clone()
s.BrickColor=Color
function Check(hit) if on then return end
if hit==nil then return end
local player=game.Players:FindFirstChild(hit.Parent.Name)
if player==nil then return end
on=true
if player.TeamColor==Color then
s.Transparency=0
s.CanCollide=false
wait(Time)
s.Transparency=ss.Transparency
s.CanCollide=true
else
local h=player.Character:FindFirstChild("Humanoid")
local t=player.Character:FindFirstChild("Torso")
if t==nil or h==nil then s.CanCollide=true s.Transparency=ss.Transparency on=false return end
if AntiHack==1 then
h.Sit=true
t.Velocity=t.CFrame:inverse().lookVector*80
elseif AntiHack==2 then
h.Health=0
elseif AntiHack==0 then
else hit.Parent=nil
end
end
on=false
end
s.Touched:connect(Check)

1 comment
I posted a answer more Easy to do, you can modify if you like. i explained all and its easy