Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local me = script.Parent.Parent
- local Light = script.Parent.Parent.Light
- local db = true
- local sensor = script.Parent
- local Window = script.Parent.Parent.Window
- local Player = game.Players.LocalPlayer
- local CorrectMusic = 'rbxassetid//826129174'
- local Police = game:GetService("Teams"):FindFirstChild("Police")
- local BadMusic = 'rbxassetid//196904458'
- KeyCard = Player.Backpack:FindFirstChild("Key Card")
- function MoveTheDoor(hit)
- print('Running')
- local hum = hit.Parent:FindFirstChild('Humanoid')
- print('1')
- if hum and KeyCard then
- print('2')
- if db then
- CorrectMusic:Play()
- db = false
- Light.Color = Color3.fromRGB(0,255,0)
- me.Position = Vector3.new(10.725, 5.075, -23.451)
- Window.Position = Vector3.new(10.725, 6.475, -23.451)
- wait()
- wait(4)
- wait()
- me.Position = Vector3.new(15.875, 5.075, -24.301)
- Light.Color = Color3.fromRGB(255,0,0)
- Window.Position = Vector3.new(15.875, 6.475, -24.401)
- wait()
- me.Anchored = true
- Window.Anchored = true
- wait(.5)
- db = true
- end
- elseif hum and Player.Team == "Police" then
- if db then
- CorrectMusic:Play()
- me.Anchored = false
- Window.Anchored = false
- db = false
- Light.Color = Color3.fromRGB(0,255,0)
- me.Position = Vector3.new(10.725, 5.075, -23.451)
- Window.Position = Vector3.new(10.725, 6.475, -23.451)
- wait()
- me.Anchored = true
- Window.Anchored = true
- wait(4)
- me.Anchored = false
- Window.Anchored = false
- wait()
- me.Position = Vector3.new(15.875, 5.075, -24.301)
- Light.Color = Color3.fromRGB(255,0,0)
- Window.Position = Vector3.new(15.875, 6.475, -24.401)
- wait()
- me.Anchored = true
- Window.Anchored = true
- wait(.5)
- db = true
- end
- end
- end
- sensor.Touched:Connect(MoveTheDoor)
Add Comment
Please, Sign In to add comment