Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Part2 = Instance.new("Part")
- ClickDetector3 = Instance.new("ClickDetector")
- Model4 = Instance.new("Model")
- Part5 = Instance.new("Part")
- Part6 = Instance.new("Part")
- Part7 = Instance.new("Part")
- Model0.Name = "music box"
- Model0.Parent = script
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-6.70001221, 9.5, -18.6999817, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(-6.70001221, 9.5, -18.6999817)
- Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part1.Size = Vector3.new(9, 1, 9)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Really black")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Really black")
- Part2.Name = "click"
- Part2.Parent = Model0
- Part2.CFrame = CFrame.new(-6.70001221, 5.400002, -18.6999817, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.Position = Vector3.new(-6.70001221, 5.400002, -18.6999817)
- Part2.Color = Color3.new(1, 1, 0)
- Part2.Transparency = 1
- Part2.Size = Vector3.new(11, 10.8000002, 11)
- Part2.Anchored = true
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.BrickColor = BrickColor.new("New Yeller")
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.brickColor = BrickColor.new("New Yeller")
- ClickDetector3.Parent = Part2
- ClickDetector3.MaxActivationDistance = 10
- Model4.Name = "color"
- Model4.Parent = Model0
- Part5.Parent = Model4
- Part5.CFrame = CFrame.new(-6.70001221, 9.5, -18.6999817, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part5.Orientation = Vector3.new(0, 90, 0)
- Part5.Position = Vector3.new(-6.70001221, 9.5, -18.6999817)
- Part5.Rotation = Vector3.new(0, 90, 0)
- Part5.Color = Color3.new(0, 1, 1)
- Part5.Size = Vector3.new(1, 1.20000005, 9.19999981)
- Part5.Anchored = true
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.BrickColor = BrickColor.new("Toothpaste")
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.brickColor = BrickColor.new("Toothpaste")
- Part6.Parent = Model4
- Part6.CFrame = CFrame.new(-6.70001221, 9.5, -18.6999817, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part6.Position = Vector3.new(-6.70001221, 9.5, -18.6999817)
- Part6.Color = Color3.new(0, 1, 1)
- Part6.Size = Vector3.new(1, 1.20000005, 9.19999981)
- Part6.Anchored = true
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.BrickColor = BrickColor.new("Toothpaste")
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.brickColor = BrickColor.new("Toothpaste")
- Part7.Parent = Model4
- Part7.CFrame = CFrame.new(-6.70001221, 4.5, -18.6999817, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part7.Position = Vector3.new(-6.70001221, 4.5, -18.6999817)
- Part7.Color = Color3.new(0, 1, 1)
- Part7.Size = Vector3.new(9, 9, 9)
- Part7.Anchored = true
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.BrickColor = BrickColor.new("Toothpaste")
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.brickColor = BrickColor.new("Toothpaste")
- local colors = script['music box']['color']
- local click = script['music box']['click']:FindFirstChildOfClass("ClickDetector")
- local click2 = click.Parent
- local max_timer = 30
- local timer = 0
- local tweening = false
- click2.CanCollide = false
- local theme = Instance.new("Sound")
- theme.SoundId = 'rbxassetid://186847938'
- theme.Volume = 1
- theme.Looped = true
- theme.Parent = click2
- theme:Play()
- local tween = Instance.new("Sound")
- tween.SoundId = 'rbxassetid://209530691'
- tween.Volume = 0.3
- tween.Looped = false
- tween.Parent = click2
- click.MouseClick:Connect(function()
- if not tweening then else return end
- tweening = true
- click.Parent = nil
- timer = timer - 10
- if 0 > timer then
- timer = 0
- end
- tween:Play()
- wait(3)
- click.Parent = click2
- tweening = false
- end)
- function explode()
- local exp = Instance.new("Explosion")
- exp.Position = click2.Position
- exp.BlastRadius = 30
- exp.DestroyJointRadiusPercent = 1
- exp.ExplosionType = Enum.ExplosionType.Craters
- exp.Parent = click2
- theme:Stop()
- local exp_s = Instance.new("Sound")
- exp_s.SoundId = 'rbxassetid://2770705979'
- exp_s.Volume = 10
- exp_s.Looped = false
- exp_s.Parent = click2
- exp_s:Play()
- exp.Hit:Connect(function(hit,dist)
- hit.Anchored = false
- end)
- end
- function change_color()
- local r,g,b = 0,1,1
- local t = timer
- if (t > max_timer) then
- t = max_timer
- end
- t = t/max_timer
- r = t
- g = g-r
- b = b-r
- for i,v in ipairs(colors:GetChildren()) do
- game:GetService("TweenService"):Create(v,TweenInfo.new(1),{Color = Color3.new(r,g,b)}):Play()
- end
- end
- while max_timer >= timer do
- wait(1)
- timer = timer + 1
- change_color()
- end
- explode()
Add Comment
Please, Sign In to add comment