Advertisement
Webcat70

Webcat70's Button Script

Jan 1st, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.84 KB | None | 0 0
  1. function sandbox(var,func)
  2.     local env = getfenv(func)
  3.     local newenv = setmetatable({},{
  4.         __index = function(self,k)
  5.             if k=="script" then
  6.                 return var
  7.             else
  8.                 return env[k]
  9.             end
  10.         end,
  11.     })
  12.     setfenv(func,newenv)
  13.     return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Model0 = Instance.new("Model")
  18. Part1 = Instance.new("Part")
  19. Part2 = Instance.new("Part")
  20. Part3 = Instance.new("Part")
  21. SurfaceGui4 = Instance.new("SurfaceGui")
  22. TextLabel5 = Instance.new("TextLabel")
  23. ClickDetector6 = Instance.new("ClickDetector")
  24. Model0.Name = "Stand"
  25. Model0.Parent = mas
  26. Part1.Name = "Post"
  27. Part1.Parent = Model0
  28. Part1.CFrame = CFrame.new(0, 1.62499905, -14.1421356, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  29. Part1.Position = Vector3.new(0, 1.62499905, -14.1421356)
  30. Part1.Size = Vector3.new(0.5, 3.25, 0.5)
  31. Part1.Anchored = true
  32. Part1.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  33. Part1.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  34. Part1.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  35. Part1.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  36. Part1.Material = Enum.Material.SmoothPlastic
  37. Part1.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  38. Part1.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  39. Part2.Name = "Pad"
  40. Part2.Parent = Model0
  41. Part2.CFrame = CFrame.new(0, 2.96966076, -13.9653606, 1, 0, 0, 0, 0.707112968, 0.707112968, 0, -0.707112968, 0.707112968)
  42. Part2.Orientation = Vector3.new(-45, 0, 0)
  43. Part2.Position = Vector3.new(0, 2.96966076, -13.9653606)
  44. Part2.Rotation = Vector3.new(-45, 0, 0)
  45. Part2.Size = Vector3.new(1, 1, 0.5)
  46. Part2.Anchored = true
  47. Part2.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  48. Part2.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  49. Part2.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  50. Part2.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  51. Part2.Material = Enum.Material.SmoothPlastic
  52. Part2.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  53. Part2.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  54. Part3.Name = "Button"
  55. Part3.Parent = Model0
  56. Part3.CFrame = CFrame.new(0, 3.16424847, -13.7709675, 1, 0, 0, 0, 0.707112968, 0.707112968, 0, -0.707112968, 0.707112968)
  57. Part3.Orientation = Vector3.new(-45, 0, 0)
  58. Part3.Position = Vector3.new(0, 3.16424847, -13.7709675)
  59. Part3.Rotation = Vector3.new(-45, 0, 0)
  60. Part3.Color = Color3.new(0.768628, 0.156863, 0.109804)
  61. Part3.Size = Vector3.new(0.700000048, 0.700000048, 0.0500000045)
  62. Part3.Anchored = true
  63. Part3.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  64. Part3.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  65. Part3.BrickColor = BrickColor.new("Bright red")
  66. Part3.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  67. Part3.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  68. Part3.Material = Enum.Material.SmoothPlastic
  69. Part3.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  70. Part3.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  71. Part3.brickColor = BrickColor.new("Bright red")
  72. SurfaceGui4.Name = "Surface"
  73. SurfaceGui4.Parent = Part3
  74. SurfaceGui4.Face = Enum.NormalId.Back
  75. SurfaceGui4.ClipsDescendants = true
  76. SurfaceGui4.CanvasSize = Vector2.new(600, 400)
  77. TextLabel5.Name = "Text"
  78. TextLabel5.Parent = SurfaceGui4
  79. TextLabel5.Position = UDim2.new(0, 50, 0, 165)
  80. TextLabel5.Size = UDim2.new(0, 500, 0, 50)
  81. TextLabel5.BackgroundColor = BrickColor.new("Institutional white")
  82. TextLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
  83. TextLabel5.BackgroundTransparency = 1
  84. TextLabel5.Font = Enum.Font.SourceSans
  85. TextLabel5.FontSize = Enum.FontSize.Size96
  86. TextLabel5.Text = "Don't Click Me"
  87. TextLabel5.TextColor = BrickColor.new("Really black")
  88. TextLabel5.TextColor3 = Color3.new(0, 0, 0)
  89. TextLabel5.TextSize = 100
  90. TextLabel5.TextStrokeTransparency = 0
  91. TextLabel5.TextWrap = true
  92. TextLabel5.TextWrapped = true
  93. ClickDetector6.Name = "Click"
  94. ClickDetector6.Parent = Part3
  95. for i,v in pairs(mas:GetChildren()) do
  96.     v.Parent = workspace
  97.     pcall(function() v:MakeJoints() end)
  98. end
  99. mas:Destroy()
  100. for i,v in pairs(cors) do
  101.     spawn(function()
  102.         pcall(v)
  103.     end)
  104. end
  105. script.Parent = Part3
  106. local d = false
  107. function onClick(player)
  108.     if d == false then
  109.         d = true
  110.         if player.Character:FindFirstChild("Humanoid") then
  111.             if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
  112.                 if player.Character:FindFirstChild("Torso") then
  113.                     local e = Instance.new("Explosion")
  114.                     e.ExplosionType = Enum.ExplosionType.NoCraters
  115.                     e.BlastPressure = 1e10
  116.                     e.Visible = false
  117.                     e.Parent = player.Character.Torso
  118.                     e.Position = player.Character.Torso.Position
  119.                 end
  120.             else
  121.                 if player.Character:FindFirstChild("UpperTorso") then
  122.                     local e = Instance.new("Explosion")
  123.                     e.ExplosionType = Enum.ExplosionType.NoCraters
  124.                     e.BlastPressure = 1e10
  125.                     e.Visible = false
  126.                     e.Parent = player.Character.UpperTorso
  127.                     e.Position = player.Character.UpperTorso.Position
  128.                 end
  129.             end
  130.         end
  131.         d = false
  132.     end
  133. end
  134. script.Parent.Click.MouseClick:Connect(onClick)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement