Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2. sel = false
  3. dist = 8
  4.  
  5. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  6. part.Parent = parent
  7. part.formFactor = form
  8. part.CanCollide = collide
  9. part.Transparency = tran
  10. part.Reflectance = ref
  11. part.Size = Vector3.new(x,y,z)
  12. part.BrickColor = BrickColor.new(color)
  13. part.TopSurface = 0
  14. part.BottomSurface = 0
  15. part.Anchored = anchor
  16. part.Locked = true
  17. part:BreakJoints()
  18. end
  19.  
  20. function mesh(mesh, parent, x, y, z, type)
  21. mesh.Parent = parent
  22. mesh.Scale = Vector3.new(x, y, z)
  23. mesh.MeshType = type
  24. end
  25.  
  26. function getparts(path)
  27. local objs = {}
  28. for _,v in pairs(path:children()) do
  29. if v:IsA("BasePart") then
  30. if v.Anchored == false then
  31. table.insert(objs,v)
  32. end
  33. end
  34. for _,k in pairs(v:children()) do
  35. if k:IsA("BasePart") then
  36. if k.Anchored == false then
  37. table.insert(objs,k)
  38. end
  39. end
  40. end
  41. end
  42. return objs
  43. end
  44.  
  45. trail = Instance.new("Part")
  46. prop(trail,nil,false,0.4,0.05,0.3,0.3,1,"Bright red",true,"Custom")
  47. trailmesh = Instance.new("BlockMesh",trail)
  48.  
  49. point = Instance.new("Part")
  50. prop(point,nil,false,0.3,0.05,1.2,0.3,1.2,"Bright violet",true,"Custom")
  51. local pm = Instance.new("SpecialMesh",point)
  52. pm.MeshType = "Sphere"
  53.  
  54. function makemine(pos)
  55. local mine = Instance.new("Model")
  56. mine.Name = "Land mine"
  57. local main = Instance.new("Part")
  58. prop(main,mine,true,0,0,1.4,0.35,1.4,"Black",true,"Custom")
  59. main.Name = "Main"
  60. Instance.new("CylinderMesh",main)
  61. main.CFrame = CFrame.new(pos) * CFrame.new(0,main.Size.Y/2,0)
  62.  
  63. local light = Instance.new("Part")
  64. prop(light,mine,true,0.2,0,1.05,0.3,1.05,"Earth green",true,"Custom")
  65. Instance.new("SpecialMesh",light).MeshType = "Sphere"
  66. light.CFrame = main.CFrame * CFrame.new(0,0.15,0)
  67.  
  68. for i=0, math.pi*2, math.pi/5 do
  69. local attachment = Instance.new("Part")
  70. prop(attachment,mine,true,0,0,0.2,0.3,0.65,"Black",true,"Custom")
  71. Instance.new("SpecialMesh",attachment).MeshType = "Wedge"
  72. attachment.CFrame = main.CFrame * CFrame.Angles(0,i,0) * CFrame.new(0,-0.05,-0.9)
  73. end
  74.  
  75. local pwning = false
  76.  
  77. coroutine.resume(coroutine.create(function()
  78. while true do
  79. wait(0.15)
  80. if mine.Parent == nil then
  81. break
  82. end
  83. if pwning == false then
  84. local obj = getparts(workspace)
  85. light.BrickColor = BrickColor.new("Earth green")
  86. for _,v in pairs(obj) do
  87. if (v.Position - main.Position).magnitude < dist then
  88. if v.Parent.Name == me.Name then
  89. light.BrickColor = BrickColor.new("Lime green")
  90. else
  91. if v.Velocity.magnitude > 4 then
  92. pwning = true
  93. for i=1, 30 do
  94. if light.BrickColor == BrickColor.new("New Yeller") then
  95. light.BrickColor = BrickColor.new("Really red")
  96. else
  97. light.BrickColor = BrickColor.new("New Yeller")
  98. end
  99. wait()
  100. end
  101. for _,o in pairs(mine:children()) do
  102. if o:IsA("BasePart") then
  103. o.Anchored = false
  104. o:BreakJoints()
  105. o.Touched:connect(function(hit)
  106. if o.Velocity.magnitude > 6 then
  107. local hu = hit.Parent:findFirstChild("Humanoid")
  108. if hu ~= nil then
  109. hu.Health = hu.Health - 10
  110. end
  111. end
  112. end)
  113. end
  114. end
  115. local ex = Instance.new("Explosion",mine)
  116. ex.Position = main.Position + Vector3.new(math.random(-100,100)/100,math.random(-80,30)/100,math.random(-100,100)/100)
  117. ex.BlastRadius = dist*1.2
  118. ex.BlastPressure = math.random(80000,210000)
  119. wait(5)
  120. mine:remove()
  121. break
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end
  128. end))
  129. mine.Parent = workspace
  130. end
  131.  
  132. if script.Parent.className ~= "HopperBin" then
  133. local h = Instance.new("HopperBin",me.Backpack)
  134. h.Name = "Landmines"
  135. script.Parent = h
  136. end
  137.  
  138. bin = script.Parent
  139.  
  140. function sel(mouse)
  141. trail.Parent = me.Character
  142. point.Parent = me.Character
  143. sel = true
  144. coroutine.resume(coroutine.create(function()
  145. while sel do
  146. local dis = (me.Character.Torso.Position - mouse.Hit.p).magnitude
  147. trailmesh.Scale = Vector3.new(1,1,dis)
  148. trail.CFrame = CFrame.new(me.Character.Torso.Position, mouse.Hit.p) * CFrame.new(0,0,-dis/2)
  149. point.CFrame = CFrame.new(mouse.Hit.p)
  150. wait()
  151. end
  152. end))
  153. mouse.Button1Down:connect(function()
  154. makemine(mouse.Hit.p)
  155. for i=0.3,1,0.1 do
  156. pm.Scale = pm.Scale + Vector3.new(0.6,4,0.6)
  157. point.Transparency = i
  158. wait()
  159. end
  160. point.Transparency = 0.3
  161. pm.Scale = Vector3.new(1,1,1)
  162. end)
  163. end
  164.  
  165. function desel(mouse)
  166. trail.Parent = nil
  167. point.Parent = nil
  168. sel = false
  169. end
  170.  
  171. bin.Deselected:connect(desel)
  172. bin.Selected:connect(sel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement