local Hinge = script.Parent.PrimaryPart
local opened = false
local Promt = script.Parent:WaitForChild("ProximityPrompt")
function OpenDoor()
if opened == false then
opened = true
for i = 1, 21 do
script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(5), 0))
wait()
end
else
opened = false
for i = 1, 21 do
script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-5), 0))
wait()
end
end
end
Promt.Triggered:Connect(function(Players)
OpenDoor()
end)
script.Parent.Door1.ProxomityPrompt.Triggered:Connect(OpenDoor)
This is the script How can i make it only for a certain team

3 comments
This sadly does not work
Try
player.Team.Name == "NameOfTeam"-- TeamColor requires a (I think) BrickColor object, not a string, so the Name is easier to compare. Also, it'd be better to do that if statement once at the beginning of the OpenDoor function (instead of having two copies of it throughout the function unnecessarily).idk worked fine for me