Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------
- ---------------The mysterious button---------------
- ---------------------------------------------------
- --Made by mrfunnylaughs4. This sure is some weird button.
- local debounce = false
- ---------------------------------------------------
- ---------------------Functions---------------------
- ---------------------------------------------------
- local function SmoothPart(part)
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.LeftSurface = "Smooth"
- part.RightSurface = "Smooth"
- part.FrontSurface = "Smooth"
- part.BackSurface = "Smooth"
- end
- local function Effect(Length, Type, SizeStart, SizeEnd, Position, Colour, Parent, CanCollide)
- local part = Instance.new("Part")
- part.Name = Type
- part.CFrame = Position
- part.CanCollide = CanCollide or false
- part.Size = SizeStart
- part.Anchored = true
- part.BrickColor = BrickColor.new(tostring(Colour))
- part.Parent = Parent or workspace
- if Type == "Block" then
- SmoothPart(part)
- end
- if Type == "Sphere" then
- part.Shape = Enum.PartType.Ball
- SmoothPart(part)
- end
- if Type == "TwirlSwirl" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.MeshId = "rbxassetid://662585058"
- mesh.Name = "SwirlMesh"
- mesh.Scale = SizeStart / Vector3.new(500, 500, 500)
- mesh.Parent = part
- end
- if Type == "Wave" or Type == "SpiralWave" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.MeshId = "rbxassetid://20329976"
- mesh.Name = "WaveMesh"
- mesh.Scale = SizeStart / Vector3.new(4, 4, 4)
- mesh.Parent = part
- end
- if Type == "MeshSphere" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = part
- SmoothPart(part)
- end
- spawn(function()
- local TwirlAngle = math.random(-250, 250) / 1000
- local WaveAngle = math.random(-500, 500) / 1000
- for i = 1, Length do
- game:GetService("RunService").Heartbeat:Wait()
- part.Transparency = part.Transparency + 1 / Length
- part.Size = part.Size + SizeEnd / Vector3.new(Length, Length, Length)
- if Type == "TwirlSwirl" then
- part.CFrame = part.CFrame * CFrame.Angles(TwirlAngle, TwirlAngle, TwirlAngle)
- part.SwirlMesh.Scale = part.SwirlMesh.Scale + SizeEnd / Vector3.new(Length * 500, Length * 500, Length * 500)
- end
- if Type == "SpiralWave" then
- part.CFrame = part.CFrame * CFrame.Angles(WaveAngle, WaveAngle, WaveAngle)
- part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
- end
- if Type == "Wave" then
- part.CFrame = part.CFrame * CFrame.Angles(0, WaveAngle, 0)
- part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
- end
- end
- part:Destroy()
- end)
- end
- ---------------------------------------------------
- -----------------Making the button-----------------
- ---------------------------------------------------
- local model = Instance.new("Model")
- model.Name = "Button"
- model.Parent = workspace
- local base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- local button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- local click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- ---------------------------------------------------
- ----------------------Attacks----------------------
- ---------------------------------------------------
- game:GetService("RunService").Heartbeat:Connect(function()
- if not click:FindFirstChild("EventHooked") then
- local val = Instance.new("BoolValue")
- val.Name = "EventHooked"
- val.Parent = click
- click.MouseClick:Connect(function(player)
- if debounce == false then
- debounce = true
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://1677936333"
- sound.Volume = 5
- sound.Parent = button
- sound:Play()
- button.CFrame = button.CFrame + Vector3.new(0, -0.15, 0)
- wait(0.2)
- button.CFrame = button.CFrame + Vector3.new(0, 0.15, 0)
- wait(0.05)
- local sound2 = Instance.new("Sound")
- sound2.SoundId = "rbxassetid://1274525620"
- sound2.Volume = 5
- sound2.Parent = button
- sound2:Play()
- wait(1.55)
- sound:Destroy()
- sound2:Destroy()
- local choice = math.random(1, 4)
- if choice == 1 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://130972023"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- Effect(40, "Sphere", Vector3.new(2, 2, 2), Vector3.new(15, 15, 15), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
- for i = 1, 4 do
- Effect(40, "SpiralWave", Vector3.new(10, 2, 10), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
- end
- for i,v in pairs(Char:GetChildren()) do
- if v:IsA("BasePart") and not v:IsA("Terrain") then
- v:BreakJoints()
- v.Velocity = Vector3.new(math.random(-25, 25), 30, math.random(-25, 25))
- end
- end
- elseif choice == 2 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://1368583274"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- for i = 1, 120 do
- game:GetService("RunService").Heartbeat:Wait()
- sound.Volume = sound.Volume - 5 / 120
- Effect(15, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- sound:Destroy()
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://165970126"
- sound.Volume = 2
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- Effect(20, "MeshSphere", Vector3.new(5, 15, 5), Vector3.new(8, 90, 8), Char.HumanoidRootPart.CFrame, BrickColor.new("Institutional white"), Char)
- for i = 1, 4 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- vel.Velocity = Vector3.new(0, 300, 0)
- vel.Parent = Char.HumanoidRootPart
- spawn(function()
- wait(0.5)
- vel:Destroy()
- end)
- elseif choice == 3 then
- local Char = player.Character
- local hole = Instance.new("Part")
- hole.Name = "Hole"
- hole.Color = Color3.new(0, 0, 0)
- hole.Shape = Enum.PartType.Cylinder
- hole.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, -3.04, 0) * CFrame.Angles(0, 0, math.pi / 2)
- hole.Size = Vector3.new(0.1, 0, 0)
- hole.Anchored = true
- hole.Locked = true
- hole.Material = Enum.Material.Neon
- hole.CanCollide = false
- SmoothPart(hole)
- hole.Parent = Char
- Char.Head.Anchored = true
- for i = 1, 35 do
- game:GetService("RunService").Heartbeat:Wait()
- hole.Size = hole.Size + Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
- end
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://838038142"
- sound.Volume = 2
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- Char:SetPrimaryPartCFrame(Char.Head.CFrame * CFrame.new(0, -0.05, 0))
- hole.CFrame = hole.CFrame + Vector3.new(0, 0.05, 0)
- until Char.HumanoidRootPart.Position.Y < hole.Position.Y - 3.4 * Char.HumanoidRootPart.Size.Z
- sound:Destroy()
- for i = 1, 35 do
- game:GetService("RunService").Heartbeat:Wait()
- hole.Size = hole.Size - Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
- end
- hole:Destroy()
- Char:BreakJoints()
- elseif choice == 4 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://130972023"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- if Char:FindFirstChildOfClass("Humanoid") then
- for i = 1, 5 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- Char:FindFirstChildOfClass("Humanoid").PlatformStand = true
- else
- for i = 1, 5 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- local bodyforce = Instance.new("BodyForce")
- bodyforce.Force = Vector3.new(0, -500000, 0)
- bodyforce.Parent = Char.Head
- end
- end
- debounce = false
- end
- end)
- end
- end)
- ---------------------------------------------------
- --------------------Wrapping up--------------------
- ---------------------------------------------------
- while game:GetService("RunService").Heartbeat:Wait() do
- if model.Parent ~= workspace then
- model = Instance.new("Model")
- model.Name = "Button"
- base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- model.Parent = workspace
- end
- if base.Parent ~= model then
- base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- end
- if button.Parent ~= model then
- button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- end
- if click.Parent ~= button then
- click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- model.Parent = workspace
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement