Advertisement
princeofheaven

Untitled

Jul 18th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. me = game.Players.PrinceOfHeaven
  2. char = me.Character
  3. place = 1
  4. trapdist = 10
  5. modes = {"jail","trap"}
  6. mode = modes[place]
  7.  
  8. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  9. part.Parent = parent
  10. part.formFactor = form
  11. part.CanCollide = collide
  12. part.Transparency = tran
  13. part.Reflectance = ref
  14. part.Size = Vector3.new(x,y,z)
  15. part.BrickColor = BrickColor.new(color)
  16. part.TopSurface = 0
  17. part.BottomSurface = 0
  18. part.Anchored = anchor
  19. part.Locked = true
  20. part:BreakJoints()
  21. end
  22.  
  23. function gettorsos(path,object)
  24. local torsos = {}
  25. for _,v in pairs(path:children()) do
  26. for _,k in pairs(v:children()) do
  27. if k.Parent:findFirstChild("Humanoid") ~= nil and k.Name == "Torso" then
  28. if (k.Position - object.Position).magnitude < trapdist then
  29. table.insert(torsos,k)
  30. end
  31. end
  32. end
  33. end
  34. return torsos
  35. end
  36.  
  37. trail = Instance.new("Part")
  38. prop(trail,nil,false,0.4,0.05,0.3,0.3,1,"Bright red",true,"Custom")
  39. trailmesh = Instance.new("BlockMesh",trail)
  40.  
  41. point = Instance.new("Part")
  42. prop(point,nil,false,0.3,0.05,1.2,0.3,1.2,"Bright violet",true,"Custom")
  43. local pm = Instance.new("SpecialMesh",point)
  44. pm.MeshType = "Sphere"
  45.  
  46. function jail(pos)
  47. local cf = CFrame.new(pos) * CFrame.new(0,3,0) * CFrame.Angles(math.rad(math.random(-360,360)),math.rad(math.random(-360,360)),math.rad(math.random(-360,360)))
  48. local mod = Instance.new("Model",workspace)
  49. mod.Name = "Jail, xS"
  50. for i=1, 360, 90 do
  51. local p = Instance.new("Part")
  52. prop(p,mod,true,1,0.1,11,11,0.2,"Bright blue",true,"Custom")
  53. p.CFrame = cf * CFrame.Angles(math.rad(i),0,0) * CFrame.new(0,0,-5.5)
  54. p.Name = "Window"
  55. end
  56. local lol = cf * CFrame.Angles(0,math.rad(90),0)
  57. for i=0, 180, 180 do
  58. local p = Instance.new("Part")
  59. prop(p,mod,true,1,0.1,11,11,0.2,"Bright blue",true,"Custom")
  60. p.CFrame = lol * CFrame.Angles(math.rad(i),0,0) * CFrame.new(0,0,-5.5)
  61. p.Name = "Window"
  62. end
  63. for i=1, 360, 90 do
  64. local p = Instance.new("Part")
  65. prop(p,mod,true,1,0.1,1.5,12.5,1.5,"Medium grey",true,"Custom")
  66. p.CFrame = cf * CFrame.Angles(math.rad(i),0,0) * CFrame.new(-5.5,0,-5.5)
  67. local o = Instance.new("Part")
  68. prop(o,mod,true,1,0.1,1.5,12.5,1.5,"Medium grey",true,"Custom")
  69. o.CFrame = cf * CFrame.Angles(math.rad(i),0,0) * CFrame.new(5.5,0,-5.5)
  70. end
  71. for i=0, 180, 180 do
  72. local p = Instance.new("Part")
  73. prop(p,mod,true,1,0.1,1.5,1.5,12.5,"Medium grey",true,"Custom")
  74. p.CFrame = lol * CFrame.Angles(math.rad(i),0,0) * CFrame.new(-5.5,-5.5,0)
  75. local o = Instance.new("Part")
  76. prop(o,mod,true,1,0.1,1.5,1.5,12.5,"Medium grey",true,"Custom")
  77. o.CFrame = lol * CFrame.Angles(math.rad(i),0,0) * CFrame.new(5.5,5.5,0)
  78. end
  79. for _,v in pairs(mod:children()) do
  80. coroutine.resume(coroutine.create(function()
  81. for i=1, 0, -0.05 do
  82. wait()
  83. if v.Name == "Window" then
  84. v.Transparency = i + 0.4
  85. else
  86. v.Transparency = i
  87. end
  88. end
  89. end))
  90. wait()
  91. end
  92. end
  93.  
  94. function trap(pos)
  95. local mod = Instance.new("Model",workspace)
  96. mod.Name = "Trap, xS"
  97. local y = 0.3
  98. for i=12.5,6,-1.5 do
  99. local p = Instance.new("Part")
  100. prop(p,mod,true,1,0.06,i,1,i,"Black",true,"Custom")
  101. p.CFrame = CFrame.new(pos) * CFrame.new(0,y,0)
  102. Instance.new("CylinderMesh",p)
  103. y = y + i/30
  104. end
  105. local p = Instance.new("Part")
  106. prop(p,mod,true,1,0.1,5,0.2,5,"Lime green",true,"Custom")
  107. p.CFrame = CFrame.new(pos) * CFrame.new(0,y+0.2,0)
  108. Instance.new("CylinderMesh",p)
  109. local trapped = false
  110. coroutine.resume(coroutine.create(function()
  111. while mod.Parent ~= nil do
  112. local objs = gettorsos(workspace,p)
  113. if trapped then break end
  114. for _,v in pairs(objs) do
  115. if trapped then break end
  116. trapped = true
  117. local bp = Instance.new("BodyPosition",v)
  118. bp.position = p.Position + Vector3.new(0,6,0)
  119. bp.P = 6000
  120. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  121. local bav = Instance.new("BodyAngularVelocity",v)
  122. bav.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  123. bav.P = 7000
  124. bav.angularvelocity = Vector3.new(0,30,0)
  125. local o = Instance.new("Part")
  126. prop(o,mod,false,0.6,0.1,1,1,1,"Lime green",true,"Custom")
  127. local mo = Instance.new("SpecialMesh",o)
  128. mo.MeshType = "Sphere"
  129. mo.Scale = Vector3.new(5.2,8,5.2)
  130. o.CFrame = p.CFrame * CFrame.new(0,-5,0)
  131. for i=-5,6,0.25 do
  132. wait()
  133. o.CFrame = p.CFrame * CFrame.new(0,i,0)
  134. end
  135. wait(5)
  136. local ex = Instance.new("Explosion",mod)
  137. ex.BlastRadius = 2
  138. ex.BlastPressure = 50000
  139. ex.Position = v.Position
  140. ex.Hit:connect(function(p)
  141. p:breakJoints()
  142. end)
  143. o:remove()
  144. for _,j in pairs(mod:children()) do
  145. coroutine.resume(coroutine.create(function()
  146. for i=0, 1, 0.1 do
  147. wait()
  148. j.Transparency = i
  149. end
  150. j:remove()
  151. end))
  152. wait(0.04)
  153. end
  154. mod:remove()
  155. bav:remove()
  156. bp:remove()
  157. end
  158. wait(0.08)
  159. end
  160. end))
  161. for _,v in pairs(mod:children()) do
  162. coroutine.resume(coroutine.create(function()
  163. for i=1, 0, -0.05 do
  164. wait()
  165. v.Transparency = i
  166. end
  167. v.Transparency = 0
  168. end))
  169. wait()
  170. end
  171. end
  172.  
  173. if script.Parent.className ~= "HopperBin" then
  174. h = Instance.new("HopperBin",me.Backpack)
  175. h.Name = "Lol?"
  176. script.Parent = h
  177. end
  178.  
  179. bin = script.Parent
  180. sel = false
  181.  
  182. bin.Selected:connect(function(mouse)
  183. sel = true
  184. trail.Parent = char
  185. point.Parent = char
  186. coroutine.resume(coroutine.create(function()
  187. while sel do
  188. local dis = (me.Character.Torso.Position - mouse.Hit.p).magnitude
  189. trailmesh.Scale = Vector3.new(1,1,dis)
  190. trail.CFrame = CFrame.new(me.Character.Torso.Position, mouse.Hit.p) * CFrame.new(0,0,-dis/2)
  191. point.CFrame = CFrame.new(mouse.Hit.p)
  192. wait()
  193. end
  194. end))
  195. mouse.Button1Down:connect(function()
  196. if mode == "jail" then
  197. jail(mouse.Hit.p)
  198. elseif mode == "trap" then
  199. trap(mouse.Hit.p)
  200. end
  201. for i=0.3,1,0.1 do
  202. pm.Scale = pm.Scale + Vector3.new(0.6,4,0.6)
  203. point.Transparency = i
  204. wait()
  205. end
  206. point.Transparency = 0.3
  207. pm.Scale = Vector3.new(1,1,1)
  208. end)
  209. mouse.KeyDown:connect(function(key)
  210. key = key:lower()
  211. if key == "q" then
  212. place = place - 1
  213. if place < 1 then
  214. place = #modes
  215. end
  216. mode = modes[place]
  217. elseif key == "e" then
  218. place = place + 1
  219. if place > #modes then
  220. place = 1
  221. end
  222. mode = modes[place]
  223. end
  224. end)
  225. end)
  226.  
  227. bin.Deselected:connect(function()
  228. sel = false
  229. trail.Parent = nil
  230. point.Parent = nil
  231. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement