This script makes it so if you are on a certain team, the proximity prompt to activate a robbery does nothing, and if you are on a different team it starts the bank robbery. How do I get it so that you can start the robbery on multiple teams?
local frame = script.Parent
local openSound = script.Parent.DoorOpen
local closeSound = script.Parent.DoorClose
local proximityprompt = frame.PromptAttachment.ProximityPrompt
local model = script.Parent.Parent
local frameClose = model:WaitForChild("DoorClosed")
local frameOpen = model:WaitForChild("DoorOpened")
local opened = model:WaitForChild("Opened")
local tweenService = game:GetService("TweenService")
local alarm = script.Parent.Parent.AlarmPart.Alarm
local alarm2 = script.Parent.Parent.AlarmPart.Alarm2
local BadGuys = game:GetService("Teams")["Team2"]
local BadGuys2 = game:GetService("Teams")["Team3"]
local GoodGuys = game:GetService("Teams")["Team1"]
local deniedsound = script.Parent.Denied
local debounce = true
proximityprompt.Triggered:Connect(function(player)
if debounce == true then
debounce = false
if player.Team == BadGuys then
print("Robbery started.")
openSound:Play()
alarm:Play()
alarm2:Play()
tweenService:Create(frame,TweenInfo.new(.35),{CFrame =
frameOpen.CFrame}):Play()
proximityprompt.Enabled = false
wait(45)
closeSound:Play()
alarm:Stop()
alarm2:Stop()
tweenService:Create(frame,TweenInfo.new(.35),{CFrame =
frameClose.CFrame}):Play()
wait(120)
proximityprompt.Enabled = true
elseif player.Team == GoodGuys then
deniedsound:Play()
print("You're on the wrong team!")
debounce = true
end
end
end)
