Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PartA = Instance.new("Part")
- PartA.Transparency = 1
- PartA.CanCollide = false
- local SA = Instance.new("Sound",PartA)
- SA.SoundId = "rbxasset://sounds/bass.mp3"
- SA.PlayOnRemove = true
- SA.TimePosition = 0.2
- local PartB = Instance.new("Part")
- PartB.Transparency = 1
- PartB.CanCollide = false
- local SB = Instance.new("Sound",PartB)
- SB.SoundId = "rbxasset://sounds/snap.mp3"
- SB.PlayOnRemove = true
- SB.TimePosition = 0.2
- local PartC = Instance.new("Part")
- PartC.Transparency = 1
- PartC.CanCollide = false
- local SC = Instance.new("Sound",PartC)
- SC.SoundId = "rbxasset://sounds/bass.mp3"
- SC.PlayOnRemove = true
- SC.TimePosition = 0.2
- PartA.Anchored = true
- PartB.Anchored = true
- PartC.Anchored = true
- local SoundCount = 0
- function PlayFX(type,pitch,vol,pos)
- coroutine.wrap(function()
- if SoundCount < 30 then
- local waiter = 0
- local Part,Sound
- if type == "A" then
- Part,Sound,waiter = PartA,SA,1
- elseif type == "B" then
- Part,Sound,waiter = PartB,SB,0.4
- elseif type == "C" then
- Part,Sound,waiter = PartC,SC,0.4
- end
- Sound.PlaybackSpeed = pitch
- Sound.Volume = vol
- Part.Position = pos
- Part.Parent = script
- Part.Parent = nil
- SoundCount = SoundCount + 1
- delay(waiter/pitch,function()
- SoundCount = SoundCount - 1
- end)
- end
- end)()
- end
- local p,p2,p3,p4,p5 = Instance.new("Part",script),Instance.new("Part",script),Instance.new("Part",script),Instance.new("Part",script),Instance.new("Part",script)
- p.Anchored = true
- p2.Anchored = true
- p3.Anchored = true
- p4.Anchored = true
- p5.Anchored = true
- p.CanCollide = false
- p2.CanCollide = false
- p3.CanCollide = false
- p4.CanCollide = false
- p5.CanCollide = false
- p.Size = Vector3.new(1,1,2)
- p.CFrame = CFrame.new(5,3,5)
- p2.Size = Vector3.new(1,1,2)
- p2.CFrame = CFrame.new(6.5,3,5)
- p3.Size = Vector3.new(1,1,2)
- p3.CFrame = CFrame.new(8,3,5)
- p4.Size = Vector3.new(1,1,2)
- p4.CFrame = CFrame.new(9.5,3,5)
- p5.Size = Vector3.new(1,1,2)
- p5.CFrame = CFrame.new(11,3,5)
- wait(0.5)
- local db, db2,db3,db4,db5 = false,false,false,false,false
- p.Touched:Connect(function()
- if not db then
- db = true
- PlayFX("B",1.75,2,p.Position)
- local tweenService = game:GetService("TweenService")
- local object = p
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p.Position) * CFrame.Angles(math.rad(20),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- delay(1, function()
- local tweenService = game:GetService("TweenService")
- local object = p
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p.Position)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- db = false
- end)
- end
- end)
- p2.Touched:Connect(function()
- if not db2 then
- db2 = true
- PlayFX("C",3,2,p2.Position)
- local tweenService = game:GetService("TweenService")
- local object = p2
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p2.Position) * CFrame.Angles(math.rad(20),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- delay(1, function()
- local tweenService = game:GetService("TweenService")
- local object = p2
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p2.Position)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- db2 = false
- end)
- end
- end)
- p3.Touched:Connect(function()
- if not db3 then
- db3 = true
- PlayFX("C",3.75,2,p3.Position)
- local tweenService = game:GetService("TweenService")
- local object = p3
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p3.Position) * CFrame.Angles(math.rad(20),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- delay(1, function()
- local tweenService = game:GetService("TweenService")
- local object = p3
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p3.Position)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- db3 = false
- end)
- end
- end)
- p4.Touched:Connect(function()
- if not db4 then
- db4 = true
- PlayFX("C",4.5,2,p4.Position)
- local tweenService = game:GetService("TweenService")
- local object = p4
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p4.Position) * CFrame.Angles(math.rad(20),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- delay(1, function()
- local tweenService = game:GetService("TweenService")
- local object = p4
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p4.Position)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- db4 = false
- end)
- end
- end)
- p5.Touched:Connect(function()
- if not db5 then
- db5 = true
- PlayFX("C",5,2,p5.Position)
- local tweenService = game:GetService("TweenService")
- local object = p5
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p5.Position) * CFrame.Angles(math.rad(20),0,0)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- delay(1, function()
- local tweenService = game:GetService("TweenService")
- local object = p5
- local tweenInfo = TweenInfo.new(0.5)
- local goal = {}
- goal.CFrame = CFrame.new(p5.Position)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- db5 = false
- end)
- end
- end)
- local parts = {}
- rail = Instance.new("Part",script)
- local at2 = Instance.new("Attachment" , workspace.Terrain)
- at2.CFrame = CFrame.new(3.5,5,2) * CFrame.Angles(0,math.rad(90),0)
- local at3 = Instance.new("Attachment" , rail)
- at3.CFrame = CFrame.Angles(0,math.rad(90),0)
- local prism2 = Instance.new("PrismaticConstraint" , rail)
- prism2.Attachment0 = at2
- prism2.Attachment1 = at3
- prism2.LimitsEnabled = true
- prism2.LowerLimit = -100
- prism2.UpperLimit = 100
- local bp = Instance.new("BodyPosition",rail)
- bp.P = 1000000000000
- bp.Position = Vector3.new(3.5,5,2)
- local bg = Instance.new("BodyGyro",rail)
- bg.P = 100000
- bg.MaxTorque = Vector3.new(100000000000,100000000000,100000000000)
- rail.CFrame = CFrame.new(3.5,5,2)
- local lastcf = CFrame.new(3.5,3,2)
- local lastcf2 = CFrame.new(0,0,0)
- for i = 1, 5 do
- local p = Instance.new("SpawnLocation",script)
- p.Enabled = false
- p.Anchored = true
- p.CFrame = lastcf * CFrame.new(1.5,0,0)
- p.Size = Vector3.new(1,1,1)
- lastcf = p.CFrame
- lastcf2 = lastcf
- local clickDetector = Instance.new("ClickDetector")
- clickDetector.Parent = p
- clickDetector.MaxActivationDistance = 50
- clickDetector.MouseClick:Connect(function(plr)
- if plr == owner then
- p.Color = Color3.new()
- end
- end)
- table.insert(parts,p)
- for i = 1, 21 - 1 do
- local p = Instance.new("SpawnLocation",script)
- p.Enabled = false
- p.Anchored = true
- p.Size = Vector3.new(1,1,1)
- p.CFrame = lastcf2 * CFrame.new(0,0,-1.5)
- lastcf2 = p.CFrame
- local clickDetector = Instance.new("ClickDetector")
- clickDetector.Parent = p
- clickDetector.MaxActivationDistance = 50
- clickDetector.MouseClick:Connect(function(plr)
- if plr == owner then
- p.Color = Color3.new()
- end
- end)
- table.insert(parts,p)
- end
- end
- owner.Chatted:Connect(function(msg)
- if msg == "!start" then
- for i,v in pairs(parts) do
- if v.Color ~= Color3.new() then
- v:Destroy()
- else
- local weld = Instance.new("WeldConstraint",rail)
- weld.Part0 = v
- weld.Part1 = rail
- v.Anchored = false
- end
- end
- local tweenService = game:GetService("TweenService")
- local object = bp
- local tweenInfo = TweenInfo.new(4)
- local goal = {}
- goal.Position = Vector3.new(3.5,5,40)
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement