Advertisement
Guest User

Untitled

a guest
Nov 5th, 2018
9,250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.53 KB | None | 0 0
  1. ---------------------------------------------------
  2. ---------------The mysterious button---------------
  3. ---------------------------------------------------
  4.  
  5. --Made by mrfunnylaughs4. This sure is some weird button.
  6.  
  7. local debounce = false
  8.  
  9. ---------------------------------------------------
  10. ---------------------Functions---------------------
  11. ---------------------------------------------------
  12.  
  13. local function SmoothPart(part)
  14. part.TopSurface = "Smooth"
  15. part.BottomSurface = "Smooth"
  16. part.LeftSurface = "Smooth"
  17. part.RightSurface = "Smooth"
  18. part.FrontSurface = "Smooth"
  19. part.BackSurface = "Smooth"
  20. end
  21.  
  22. local function Effect(Length, Type, SizeStart, SizeEnd, Position, Colour, Parent, CanCollide)
  23. local part = Instance.new("Part")
  24. part.Name = Type
  25. part.CFrame = Position
  26. part.CanCollide = CanCollide or false
  27. part.Size = SizeStart
  28. part.Anchored = true
  29. part.BrickColor = BrickColor.new(tostring(Colour))
  30. part.Parent = Parent or workspace
  31. if Type == "Block" then
  32. SmoothPart(part)
  33. end
  34. if Type == "Sphere" then
  35. part.Shape = Enum.PartType.Ball
  36. SmoothPart(part)
  37. end
  38. if Type == "TwirlSwirl" then
  39. local mesh = Instance.new("SpecialMesh")
  40. mesh.MeshType = Enum.MeshType.FileMesh
  41. mesh.MeshId = "rbxassetid://662585058"
  42. mesh.Name = "SwirlMesh"
  43. mesh.Scale = SizeStart / Vector3.new(500, 500, 500)
  44. mesh.Parent = part
  45. end
  46. if Type == "Wave" or Type == "SpiralWave" then
  47. local mesh = Instance.new("SpecialMesh")
  48. mesh.MeshType = Enum.MeshType.FileMesh
  49. mesh.MeshId = "rbxassetid://20329976"
  50. mesh.Name = "WaveMesh"
  51. mesh.Scale = SizeStart / Vector3.new(4, 4, 4)
  52. mesh.Parent = part
  53. end
  54. if Type == "MeshSphere" then
  55. local mesh = Instance.new("SpecialMesh")
  56. mesh.MeshType = Enum.MeshType.Sphere
  57. mesh.Parent = part
  58. SmoothPart(part)
  59. end
  60. spawn(function()
  61. local TwirlAngle = math.random(-250, 250) / 1000
  62. local WaveAngle = math.random(-500, 500) / 1000
  63. for i = 1, Length do
  64. game:GetService("RunService").Heartbeat:Wait()
  65. part.Transparency = part.Transparency + 1 / Length
  66. part.Size = part.Size + SizeEnd / Vector3.new(Length, Length, Length)
  67. if Type == "TwirlSwirl" then
  68. part.CFrame = part.CFrame * CFrame.Angles(TwirlAngle, TwirlAngle, TwirlAngle)
  69. part.SwirlMesh.Scale = part.SwirlMesh.Scale + SizeEnd / Vector3.new(Length * 500, Length * 500, Length * 500)
  70. end
  71. if Type == "SpiralWave" then
  72. part.CFrame = part.CFrame * CFrame.Angles(WaveAngle, WaveAngle, WaveAngle)
  73. part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
  74. end
  75. if Type == "Wave" then
  76. part.CFrame = part.CFrame * CFrame.Angles(0, WaveAngle, 0)
  77. part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
  78. end
  79. end
  80. part:Destroy()
  81. end)
  82. end
  83.  
  84. ---------------------------------------------------
  85. -----------------Making the button-----------------
  86. ---------------------------------------------------
  87.  
  88. local model = Instance.new("Model")
  89. model.Name = "Button"
  90. model.Parent = workspace
  91. local base = Instance.new("Part")
  92. base.Name = "Base"
  93. base.Size = Vector3.new(1, 4, 4)
  94. base.Shape = Enum.PartType.Cylinder
  95. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  96. base.BrickColor = BrickColor.new("Medium stone grey")
  97. base.Anchored = true
  98. base.Locked = true
  99. SmoothPart(base)
  100. base.Parent = model
  101. local button = Instance.new("Part")
  102. button.Name = "Button"
  103. button.Size = Vector3.new(1, 3.4, 3.4)
  104. button.Shape = Enum.PartType.Cylinder
  105. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  106. button.BrickColor = BrickColor.new("Bright red")
  107. button.Anchored = true
  108. button.Locked = true
  109. SmoothPart(button)
  110. button.Parent = model
  111. local click = Instance.new("ClickDetector")
  112. click.Name = "MouseClickDetect"
  113. click.MaxActivationDistance = 8
  114. click.Parent = button
  115.  
  116. ---------------------------------------------------
  117. ----------------------Attacks----------------------
  118. ---------------------------------------------------
  119.  
  120. game:GetService("RunService").Heartbeat:Connect(function()
  121. if not click:FindFirstChild("EventHooked") then
  122. local val = Instance.new("BoolValue")
  123. val.Name = "EventHooked"
  124. val.Parent = click
  125. click.MouseClick:Connect(function(player)
  126. if debounce == false then
  127. debounce = true
  128. local sound = Instance.new("Sound")
  129. sound.SoundId = "rbxassetid://1677936333"
  130. sound.Volume = 5
  131. sound.Parent = button
  132. sound:Play()
  133. button.CFrame = button.CFrame + Vector3.new(0, -0.15, 0)
  134. wait(0.2)
  135. button.CFrame = button.CFrame + Vector3.new(0, 0.15, 0)
  136. wait(0.05)
  137. local sound2 = Instance.new("Sound")
  138. sound2.SoundId = "rbxassetid://1274525620"
  139. sound2.Volume = 5
  140. sound2.Parent = button
  141. sound2:Play()
  142. wait(1.55)
  143. sound:Destroy()
  144. sound2:Destroy()
  145. local choice = math.random(1, 4)
  146. if choice == 1 then
  147. local Char = player.Character
  148. local sound = Instance.new("Sound")
  149. sound.SoundId = "rbxassetid://130972023"
  150. sound.Volume = 5
  151. sound.Parent = Char.HumanoidRootPart
  152. sound:Play()
  153. Effect(40, "Sphere", Vector3.new(2, 2, 2), Vector3.new(15, 15, 15), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
  154. for i = 1, 4 do
  155. Effect(40, "SpiralWave", Vector3.new(10, 2, 10), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
  156. end
  157. for i,v in pairs(Char:GetChildren()) do
  158. if v:IsA("BasePart") and not v:IsA("Terrain") then
  159. v:BreakJoints()
  160. v.Velocity = Vector3.new(math.random(-25, 25), 30, math.random(-25, 25))
  161. end
  162. end
  163. elseif choice == 2 then
  164. local Char = player.Character
  165. local sound = Instance.new("Sound")
  166. sound.SoundId = "rbxassetid://1368583274"
  167. sound.Volume = 5
  168. sound.Parent = Char.HumanoidRootPart
  169. sound:Play()
  170. for i = 1, 120 do
  171. game:GetService("RunService").Heartbeat:Wait()
  172. sound.Volume = sound.Volume - 5 / 120
  173. 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)
  174. end
  175. sound:Destroy()
  176. local sound = Instance.new("Sound")
  177. sound.SoundId = "rbxassetid://165970126"
  178. sound.Volume = 2
  179. sound.Parent = Char.HumanoidRootPart
  180. sound:Play()
  181. Effect(20, "MeshSphere", Vector3.new(5, 15, 5), Vector3.new(8, 90, 8), Char.HumanoidRootPart.CFrame, BrickColor.new("Institutional white"), Char)
  182. for i = 1, 4 do
  183. 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)
  184. end
  185. local vel = Instance.new("BodyVelocity")
  186. vel.MaxForce = Vector3.new(1e9, 1e9, 1e9)
  187. vel.Velocity = Vector3.new(0, 300, 0)
  188. vel.Parent = Char.HumanoidRootPart
  189. spawn(function()
  190. wait(0.5)
  191. vel:Destroy()
  192. end)
  193. elseif choice == 3 then
  194. local Char = player.Character
  195. local hole = Instance.new("Part")
  196. hole.Name = "Hole"
  197. hole.Color = Color3.new(0, 0, 0)
  198. hole.Shape = Enum.PartType.Cylinder
  199. hole.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, -3.04, 0) * CFrame.Angles(0, 0, math.pi / 2)
  200. hole.Size = Vector3.new(0.1, 0, 0)
  201. hole.Anchored = true
  202. hole.Locked = true
  203. hole.Material = Enum.Material.Neon
  204. hole.CanCollide = false
  205. SmoothPart(hole)
  206. hole.Parent = Char
  207. Char.Head.Anchored = true
  208. for i = 1, 35 do
  209. game:GetService("RunService").Heartbeat:Wait()
  210. hole.Size = hole.Size + Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
  211. end
  212. local sound = Instance.new("Sound")
  213. sound.SoundId = "rbxassetid://838038142"
  214. sound.Volume = 2
  215. sound.Parent = Char.HumanoidRootPart
  216. sound:Play()
  217. repeat
  218. game:GetService("RunService").Heartbeat:Wait()
  219. Char:SetPrimaryPartCFrame(Char.Head.CFrame * CFrame.new(0, -0.05, 0))
  220. hole.CFrame = hole.CFrame + Vector3.new(0, 0.05, 0)
  221. until Char.HumanoidRootPart.Position.Y < hole.Position.Y - 3.4 * Char.HumanoidRootPart.Size.Z
  222. sound:Destroy()
  223. for i = 1, 35 do
  224. game:GetService("RunService").Heartbeat:Wait()
  225. hole.Size = hole.Size - Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
  226. end
  227. hole:Destroy()
  228. Char:BreakJoints()
  229. elseif choice == 4 then
  230. local Char = player.Character
  231. local sound = Instance.new("Sound")
  232. sound.SoundId = "rbxassetid://130972023"
  233. sound.Volume = 5
  234. sound.Parent = Char.HumanoidRootPart
  235. sound:Play()
  236. if Char:FindFirstChildOfClass("Humanoid") then
  237. for i = 1, 5 do
  238. 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)
  239. end
  240. Char:FindFirstChildOfClass("Humanoid").PlatformStand = true
  241. else
  242. for i = 1, 5 do
  243. 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)
  244. end
  245. local bodyforce = Instance.new("BodyForce")
  246. bodyforce.Force = Vector3.new(0, -500000, 0)
  247. bodyforce.Parent = Char.Head
  248. end
  249. end
  250. debounce = false
  251. end
  252. end)
  253. end
  254. end)
  255.  
  256. ---------------------------------------------------
  257. --------------------Wrapping up--------------------
  258. ---------------------------------------------------
  259.  
  260. while game:GetService("RunService").Heartbeat:Wait() do
  261. if model.Parent ~= workspace then
  262. model = Instance.new("Model")
  263. model.Name = "Button"
  264. base = Instance.new("Part")
  265. base.Name = "Base"
  266. base.Size = Vector3.new(1, 4, 4)
  267. base.Shape = Enum.PartType.Cylinder
  268. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  269. base.BrickColor = BrickColor.new("Medium stone grey")
  270. base.Anchored = true
  271. base.Locked = true
  272. SmoothPart(base)
  273. base.Parent = model
  274. button = Instance.new("Part")
  275. button.Name = "Button"
  276. button.Size = Vector3.new(1, 3.4, 3.4)
  277. button.Shape = Enum.PartType.Cylinder
  278. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  279. button.BrickColor = BrickColor.new("Bright red")
  280. button.Anchored = true
  281. button.Locked = true
  282. SmoothPart(button)
  283. button.Parent = model
  284. click = Instance.new("ClickDetector")
  285. click.Name = "MouseClickDetect"
  286. click.MaxActivationDistance = 8
  287. click.Parent = button
  288. model.Parent = workspace
  289. end
  290. if base.Parent ~= model then
  291. base = Instance.new("Part")
  292. base.Name = "Base"
  293. base.Size = Vector3.new(1, 4, 4)
  294. base.Shape = Enum.PartType.Cylinder
  295. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  296. base.BrickColor = BrickColor.new("Medium stone grey")
  297. base.Anchored = true
  298. base.Locked = true
  299. SmoothPart(base)
  300. base.Parent = model
  301. end
  302. if button.Parent ~= model then
  303. button = Instance.new("Part")
  304. button.Name = "Button"
  305. button.Size = Vector3.new(1, 3.4, 3.4)
  306. button.Shape = Enum.PartType.Cylinder
  307. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  308. button.BrickColor = BrickColor.new("Bright red")
  309. button.Anchored = true
  310. button.Locked = true
  311. SmoothPart(button)
  312. button.Parent = model
  313. end
  314. if click.Parent ~= button then
  315. click = Instance.new("ClickDetector")
  316. click.Name = "MouseClickDetect"
  317. click.MaxActivationDistance = 8
  318. click.Parent = button
  319. model.Parent = workspace
  320. end
  321. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement