Advertisement
IHackShootingGames

Untitled

Sep 9th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.54 KB | None | 0 0
  1. pitch
  2. s.Parent = P
  3. return s
  4. end
  5. }
  6.  
  7. function find(tab, arg)
  8. local ah = nil
  9. for i,v in pairs(tab) do
  10. if v == arg then
  11. ah = v
  12. end
  13. end
  14. return ah
  15. end
  16.  
  17. function getAllParts(from)
  18. local t = {}
  19. function getParts(where)
  20. for i, v in pairs(where:children()) do
  21. if v:IsA("BasePart") then
  22. if v.Parent ~= char and v.Parent.Parent ~= char then
  23. table.insert(t, v)
  24. end
  25. end
  26. getParts(v)
  27. end
  28. end
  29. getParts(workspace)
  30. return t
  31. end
  32.  
  33. function RayCast(pos1, pos2, maxDist, forward)
  34. local list = getAllParts(workspace)
  35. local pos0 = pos1
  36. for dist = 1, maxDist, forward do
  37. pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p
  38. for _, v in pairs(list) do
  39. local pos3 = v.CFrame:pointToObjectSpace(pos0)
  40. local s = v.Size
  41. if pos3.x > -(s.x/2) and pos3.x < (s.x/2) and pos3.y > -(s.y/2) and pos3.y < (s.y/2) and pos3.z > -(s.z/2) and pos3.x < (s.z/2) and v.CanCollide == true then
  42. return pos0, v
  43. end
  44. end
  45. end
  46. return pos0, nil
  47. end
  48.  
  49. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  50. local p = Instance.new("Part")
  51. p.formFactor = "Custom"
  52. p.Anchored = Anchor
  53. p.CanCollide = Collide
  54. p.Transparency = Tran
  55. p.Reflectance = Ref
  56. p.BrickColor = BrickColor.new(Color)
  57. for _, Surf in pairs(Surfaces) do
  58. p[Surf] = "Smooth"
  59. end
  60. p.Size = Vector3.new(X, Y, Z)
  61. if Break then
  62. p:BreakJoints()
  63. else p:MakeJoints() end
  64. p.Parent = Parent
  65. return p
  66. end
  67.  
  68. function Weld(p0, p1, x, y, z, a, b, c)
  69. local w = Instance.new("Weld")
  70. w.Parent = p0
  71. w.Part0 = p0
  72. w.Part1 = p1
  73. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  74. return w
  75. end
  76.  
  77. function ComputePos(pos1, pos2)
  78. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  79. return CFrame.new(pos1, pos3)
  80. end
  81.  
  82. function getHumanoid(c)
  83. local h = nil
  84. for i,v in pairs(c:children()) do
  85. if v:IsA("Humanoid") then
  86. if v.Health > 0 then
  87. h = v
  88. end
  89. end
  90. end
  91. return h
  92. end
  93.  
  94. for i,v in pairs(char:children()) do
  95. if v.Name == Modelname then
  96. v:remove()
  97. end
  98. end
  99.  
  100. torso = char.Torso
  101. neck = torso.Neck
  102. hum = char.Humanoid
  103. Rarm = char["Right Arm"]
  104. Larm = char["Left Arm"]
  105. Rleg = char["Right Leg"]
  106. Lleg = char["Left Leg"]
  107.  
  108. hc = Instance.new("Humanoid")
  109. hc.Health = 0
  110. hc.MaxHealth = 0
  111.  
  112. slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 0.8)
  113. hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6)
  114. charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65)
  115. boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3)
  116. smashsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2692806", 0.8, 0.35)
  117. boomboom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2760979", 1, 0.18)
  118.  
  119. function PlaySound(sound, pitch, vol)
  120. local s = sound:clone()
  121. if pitch ~= nil then
  122. if tonumber(pitch) then
  123. s.Pitch = tonumber(pitch)
  124. end
  125. end
  126. if vol ~= nil then
  127. if tonumber(vol) then
  128. s.Volume = tonumber(vol)
  129. end
  130. end
  131. s.Parent = torso
  132. s.PlayOnRemove = true
  133. coroutine.resume(coroutine.create(function()
  134. wait()
  135. s:remove()
  136. end))
  137. end
  138.  
  139. Mo = Instance.new("Model")
  140. Mo.Name = Modelname
  141.  
  142. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  143. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  144. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  145. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  146.  
  147. RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  148. LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  149. RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  150. LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  151.  
  152. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  153. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  154. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  155. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  156.  
  157. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  158. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  159. HW = Weld(HB, nil, 0, 0.3, 0, math.pi/2, math.pi, 0)
  160.  
  161. Mo.Parent = char
  162.  
  163. function MakeBanana()
  164. local Banana = Part(workspace, false, true, 0, 0, "Bright yellow", 0.9, 0.95, 0.9, true)
  165. Banana.Friction = 0.8
  166. Banana.Elasticity = 0
  167. local mes = Add.Mesh(Banana, "http://www.roblox.com/asset/?id=28937301", 1.3, 0.8, 1.3)
  168. mes.TextureId = "http://www.roblox.com/asset/?id=28937670"
  169. HW.Part1 = Banana
  170. return Banana
  171. end
  172.  
  173. if script.Parent.className ~= "HopperBin" then
  174. h = Instance.new("HopperBin",me.Backpack)
  175. h.Name = Toolname
  176. h.TextureId = ToolIcon
  177. script.Parent = h
  178. end
  179.  
  180. bin = script.Parent
  181.  
  182. function detach(bool)
  183. LLW.C0 = CFrame.new(0, 0, 0)
  184. RLW.C0 = CFrame.new(0, 0, 0)
  185. LAW.C0 = CFrame.new(0,0,0)
  186. RAW.C0 = CFrame.new(0, 0, 0)
  187. if bool then
  188. LLW.Part1 = nil
  189. RLW.Part1 = nil
  190. RAW.Part1 = nil
  191. LAW.Part1 = nil
  192. end
  193. end
  194.  
  195. function attach()
  196. RAW.Part1 = Rarm
  197. LAW.Part1 = Larm
  198. RLW.Part1 = Rleg
  199. LLW.Part1 = Lleg
  200. end
  201.  
  202. function normal()
  203. neck.C0 = NeckStand
  204. RAW.C0 = RAWStand
  205. LAW.C0 = LAWStand
  206. RLW.C0 = RLWStand
  207. LLW.C0 = LLWStand
  208. RAW.C1 = CFrame.new(0, 0.5, 0)
  209. LAW.C1 = CFrame.new(0, 0.5, 0)
  210. RLW.C1 = CFrame.new(0, 0.8, 0)
  211. LLW.C1 = CFrame.new(0, 0.8, 0)
  212. HW.C0 = HWStand
  213. end
  214.  
  215. function throw(mousepos)
  216. RAW.Part1 = Rarm
  217. for i = 0, 1, 0.2 do
  218. RAW.C0 = CFrame.Angles(math.rad(-5*i), 0, math.rad(-15*i)) * CFrame.new(0, -0.2*i, -0.5*i)
  219. wait()
  220. end
  221. local banana = MakeBanana()
  222. for i = 0, 1, 0.14 do
  223. RAW.C0 = CFrame.Angles(math.rad(-5+185*i), 0, math.rad(-15+35*i)) * CFrame.new(0, -0.2+0.1*i, -0.5+0.8*i)
  224. wait()
  225. end
  226. for i = 0, 1, 0.25 do
  227. RAW.C0 = CFrame.Angles(math.rad(-5+185-90*i), 0, math.rad(-15+35-45*i)) * CFrame.new(0, -0.2+0.1-0.4*i, -0.5+0.8-0.3*i)
  228. wait()
  229. end
  230. local pos = CFrame.new(banana.Position, mousepos) * CFrame.Angles(math.rad(25),0,0)
  231. local mag = (torso.Position - mousepos).magnitude
  232. mag = mag - (mag/5)
  233. if mag > 25 then mag = 25 end
  234. local kert = (40+(mag*2))
  235. Notime(function()
  236. HW.Part1 = nil
  237. wait()
  238. banana.Velocity = pos.lookVector * kert
  239. local bg = Add.BG(banana)
  240. bg.P = 4500
  241. bg.maxTorque = Vector3.new(math.huge, 0, math.huge)
  242. wait(0.5)
  243. repeat wait() until banana.Velocity.magnitude < 13
  244. local ablez = true
  245. local con = banana.Touched:connect(function(hit)
  246. local hu = getHumanoid(hit.Parent)
  247. if hu then
  248. local to = hu.Parent:findFirstChild("Torso")
  249. if to and ablez then
  250. ablez = false
  251. local bg = Add.BG(to)
  252. hu.PlatformStand = true
  253. local cf1 = to.CFrame
  254. local cf2 = CFrame.new(cf1.p, (cf1 * CFrame.new(0, 0, -2).p))
  255. to.Velocity = to.Velocity + (cf1.lookVector * -15) + Vector3.new(0, 35, 0)
  256. local ah = math.random(260,280)
  257. local mm = math.random(5,8)/100
  258. Notime(function()
  259. wait(0.25)
  260. ablez = true
  261. end)
  262. banana.Velocity = cf1.lookVector * 35
  263. for i = 0, 1, mm do
  264. bg.cframe = cf2 * CFrame.Angles(math.rad(ah*i), 0, 0)
  265. wait()
  266. end
  267. wait()
  268. bg:remove()
  269. wait(0.4)
  270. hu.PlatformStand = false
  271. end
  272. end
  273. end)
  274. wait(math.random(18,22))
  275. con:disconnect()
  276. for i = 0, 1, 0.033 do
  277. banana.Transparency = i
  278. wait()
  279. end
  280. banana:remove()
  281. end)
  282. for i = 0, 1, 0.16 do
  283. RAW.C0 = CFrame.Angles(math.rad(-5+185-90-90*i), 0, math.rad(-15+35-45+25*i)) * CFrame.new(0, -0.2+0.1-0.4+0.5*i, 0)
  284. wait()
  285. end
  286. detach(true)
  287. end
  288.  
  289. function select(mouse)
  290. selected = true
  291. mouse.Button1Down:connect(function()
  292. if Able then
  293. Able = false
  294. throw(mouse.Hit.p)
  295. wait(0.5)
  296. Able = true
  297. end
  298. end)
  299. end
  300.  
  301. function deselect(mouse)
  302. selected = false
  303. end
  304.  
  305. bin.Selected:connect(select)
  306. bin.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement