assholeIhateyou

Untitled

Jun 27th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. dmg = 15
  2. me = game.Players.alfielenny004
  3. char = me.Character
  4. name = "XBowS"
  5. hold = false
  6. order = 1
  7. modes = {"Normal", "Pull"}
  8. mode = modes[order]
  9.  
  10. shoot = Instance.new("Sound")
  11. shoot.Looped = false
  12. shoot.Volume = 0.8
  13. shoot.Pitch = 1.7
  14. shoot.SoundId = "http://www.roblox.com/asset/?id=2691586"
  15.  
  16. function getnoobs(pos,dist)
  17. local stoof = {}
  18. local mods = {}
  19. for _,v in pairs(workspace:children()) do
  20. if v:IsA("BasePart") then
  21. if (v.Position - pos).magnitude < dist and v.Anchored == false then
  22. table.insert(stoof,v)
  23. end
  24. elseif v:IsA("Model") and v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= char then
  25. if (v.Torso.Position - pos).magnitude < dist then
  26. table.insert(mods,v)
  27. end
  28. end
  29. for _,k in pairs(v:children()) do
  30. if k:IsA("BasePart") then
  31. if (k.Position - pos).magnitude < dist and k.Anchored == false then
  32. table.insert(stoof,k)
  33. end
  34. end
  35. for _,o in pairs(k:children()) do
  36. if o:IsA("BasePart") then
  37. if (o.Position - pos).magnitude < dist and o.Anchored == false then
  38. table.insert(stoof,o)
  39. end
  40. end
  41. end
  42. end
  43. end
  44. return stoof, mods
  45. end
  46.  
  47. function getonenoob(pos,dist)
  48. local mod
  49. local to
  50. local tem
  51. local d = dist
  52. for i,v in pairs(workspace:children()) do
  53. to, tem = v:findFirstChild("Torso"), v:findFirstChild("Humanoid")
  54. if v:IsA("Model") and to ~= nil and tem ~= nil then
  55. if (to.Position - pos).magnitude <= d then
  56. mod = v
  57. d = (to.Position - pos).magnitude
  58. end
  59. end
  60. end
  61. return mod
  62. end
  63.  
  64. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  65. part.Parent = parent
  66. part.formFactor = form
  67. part.CanCollide = collide
  68. part.Transparency = tran
  69. part.Reflectance = ref
  70. part.Size = Vector3.new(x,y,z)
  71. part.BrickColor = BrickColor.new(color)
  72. part.TopSurface = 0
  73. part.BottomSurface = 0
  74. part.Anchored = anchor
  75. part.Locked = true
  76. part:BreakJoints()
  77. end
  78.  
  79. function weld(w, p, p1, a, b, c, x, y, z)
  80. w.Parent = p
  81. w.Part0 = p
  82. w.Part1 = p1
  83. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  84. end
  85.  
  86. rarm = char:findFirstChild("Right Arm")
  87. larm = char:findFirstChild("Left Arm")
  88. torso = char:findFirstChild("Torso")
  89. hum = char:findFirstChild("Humanoid")
  90.  
  91. for i,v in pairs(char:children()) do
  92. if v.Name == name then v:remove() end
  93. end
  94.  
  95. launcher = Instance.new("Model")
  96. launcher.Name = name
  97.  
  98. main = Instance.new("Part")
  99. prop( main, launcher, false, 0, 0, 0.8, 1.8, 0.6, "Dusty Rose", false, "Custom" )
  100. Instance.new("SpecialMesh",main).MeshType = "Sphere"
  101.  
  102. torsoweld = Instance.new("Weld")
  103. weld( torsoweld, torso, main, 0, 0, math.pi/4.5, 0, 0, -0.7 )
  104.  
  105. shoot.Parent = main
  106.  
  107. for i = -20, 84, 8 do
  108. local lapa = Instance.new("Part")
  109. prop( lapa, launcher, false, 0, 0, 0.5, 0.23, 0.2, "Reddish brown", false, "Custom" )
  110. Instance.new("BlockMesh",lapa)
  111. local w = Instance.new("Weld")
  112. w.C0 = CFrame.new(0,-1.25,-1.4) * CFrame.Angles(math.rad(i),0,0)
  113. weld(w,main,lapa,0,0,0,0,0,-1.5)
  114. end
  115.  
  116. for i = 20, -84, -8 do
  117. local lapa = Instance.new("Part")
  118. prop( lapa, launcher, false, 0, 0, 0.5, 0.23, 0.2, "Reddish brown", false, "Custom" )
  119. Instance.new("BlockMesh",lapa)
  120. local w = Instance.new("Weld")
  121. w.C0 = CFrame.new(0,1.25,-1.4) * CFrame.Angles(math.rad(i),0,0)
  122. weld(w,main,lapa,0,0,0,0,0,-1.5)
  123. end
  124.  
  125. string1 = Instance.new("Part")
  126. prop( string1, launcher, false, 0, 0, 0.2, 2.8, 0.2, "Institutional white", false, "Custom" )
  127. Instance.new("CylinderMesh",string1).Scale = Vector3.new(0.4,1,0.4)
  128.  
  129. str1 = Instance.new("Weld")
  130. weld(str1,main,string1,0,0,0,0,-1.4,1.25)
  131.  
  132. string2 = Instance.new("Part")
  133. prop( string2, launcher, false, 0, 0, 0.2, 2.8, 0.2, "Institutional white", false, "Custom" )
  134. Instance.new("CylinderMesh",string2).Scale = Vector3.new(0.4,1,0.4)
  135.  
  136. str2 = Instance.new("Weld")
  137. weld(str2,main,string2,0,0,0,0,1.4,1.25)
  138.  
  139. hbr = Instance.new("Part")
  140. prop( hbr, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  141. hwr = Instance.new("Weld")
  142. weld( hwr, rarm, hbr, 0, 0, 0, 0, 0.93, 0)
  143.  
  144. hbl = Instance.new("Part")
  145. prop( hbl, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  146. hwl = Instance.new("Weld")
  147. weld( hwl, larm, hbl, 0, 0, 0, 0, 0.93, 0)
  148.  
  149. rb = Instance.new("Part")
  150. prop( rb, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  151. rh = Instance.new("Weld")
  152. weld( rh, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
  153.  
  154. lb = Instance.new("Part")
  155. prop( lb, launcher, false, 1, 0, 0.1, 0.1, 0.1, "Bright red", false, "Custom" )
  156. lh = Instance.new("Weld")
  157. weld( lh, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
  158.  
  159. rw = Instance.new("Weld")
  160. weld(rw,rb,nil,0,0,0,0,0.5,0)
  161.  
  162. lw = Instance.new("Weld")
  163. weld(lw,lb,nil,0,0,0,0,0.5,0)
  164.  
  165. holdr = Instance.new("Weld")
  166. weld(holdr,hbr,nil,0,0,0,0,0,0)
  167.  
  168. holdl = Instance.new("Weld")
  169. weld(holdl,hbl,nil,-math.pi/2,0.06,math.pi/6,0,0,0)
  170.  
  171. rightbattle = nil
  172. leftbattle = nil
  173.  
  174. launcher.Parent = char
  175.  
  176. function selectanim()
  177. lw.Part1 = larm
  178. rw.Part1 = rarm
  179. for i=0,50,10 do
  180. lw.C0 = CFrame.Angles(math.rad(i),math.rad(-i*1.5),math.rad(i/2.7)) * CFrame.new(0,math.rad(-i/3),0)
  181. lh.C0 = CFrame.new(math.rad(i),0,math.rad(-i/1.6))
  182. rw.C0 = CFrame.Angles(math.rad(i/1.5),0,0) * CFrame.new(0,0,0)
  183. wait()
  184. end
  185. local rwn, lwn, lhn, holdln = rw.C0, lw.C0, lh.C0, holdl.C0
  186. if rightbattle == nil then
  187. rightbattle = rwn
  188. leftbattle = lwn
  189. end
  190. torsoweld.Part1 = nil
  191. holdl.Part1 = main
  192. end
  193.  
  194. function deselanim()
  195. rw.Part1 = nil
  196. lw.Part1 = nil
  197. torsoweld.Part1 = main
  198. holdl.Part1 = nil
  199. holdr.Part1 = nil
  200. rw.C0 = CFrame.new(0,0,0)
  201. lw.C0 = CFrame.new(0,0,0)
  202. holdl.C0 = CFrame.new(0,0,0)
  203. holdr.C0 = CFrame.new(0,0,0)
  204. rh.C0 = CFrame.new(0,0,0)
  205. end
  206.  
  207. function makearrow(p)
  208. local arrow = Instance.new("Model")
  209. arrow.Name = "xSArrow"
  210. local pa = Instance.new("Part")
  211. prop(pa, arrow, true, 0, 0, 0.2, 0.2, 3.7, "Brown", false, "Custom")
  212. pa.CFrame = p.CFrame
  213.  
  214. local tip = Instance.new("Part")
  215. prop(tip, arrow, true, 0, 0, 0.34, 0.34, 0.7, "Medium grey", false, "Custom")
  216. tip.CFrame = pa.CFrame
  217. Instance.new("SpecialMesh",tip).MeshType = "Sphere"
  218.  
  219. local tw = Instance.new("Weld")
  220. weld(tw, pa, tip, 0, 0, 0, 0, 0, -1.85)
  221.  
  222. local wa = Instance.new("Weld")
  223. weld(wa, p, pa, 0, 0, 0, -0.2, 0, -0.6)
  224. arrow.Parent = launcher
  225.  
  226. return arrow, pa, wa
  227. end
  228.  
  229. if script.Parent.className ~= "HopperBin" then
  230. h = Instance.new("HopperBin",me.Backpack)
  231. h.Name = "xBowS"
  232. script.Parent = h
  233. end
  234.  
  235. bin = script.Parent
  236.  
  237. function select(mouse)
  238. selectanim()
  239. mouse.Button1Down:connect(function()
  240. local poz = mouse.Hit.p
  241. if mode == "Normal" then
  242. order = order + 1
  243. mode = modes[order]
  244. for i=0,55,5 do
  245. lw.C0 = leftbattle * CFrame.Angles(math.rad(i*1.8),math.rad(i),math.rad(-i))
  246. holdl.C0 = CFrame.Angles(0,math.rad(-i/1.5),math.rad(-i/2))
  247. rw.C0 = rightbattle * CFrame.Angles(math.rad(i),0,math.rad(-i/2)) * CFrame.new(0,0,math.rad(i/3))
  248. wait()
  249. end
  250. elseif mode == "Pull" then
  251. order = 1
  252. mode = modes[order]
  253. local meh, lol = rw.C0, lw.C0
  254. local arrow, pa, wa = makearrow(main)
  255. for i=0,30,5 do
  256. str1.C0 = CFrame.new(0,0,-i/22) * CFrame.Angles(math.rad(i),0,0)
  257. str2.C0 = CFrame.new(0,i/90,-i/22) * CFrame.Angles(math.rad(-i),0,0)
  258. rw.C0 = meh * CFrame.Angles(0,0,math.rad(i)) * CFrame.new(0,math.rad(i*1.5),0)
  259. wa.C0 = CFrame.new(0,0,math.rad(-i*2))
  260. wait()
  261. end
  262. for i=30,0,-15 do
  263. str1.C0 = CFrame.new(0,0,-i/22) * CFrame.Angles(math.rad(i),0,0)
  264. str2.C0 = CFrame.new(0,i/90,-i/22) * CFrame.Angles(math.rad(-i),0,0)
  265. wa.C0 = CFrame.new(0,0,math.rad(-i*3))
  266. wait()
  267. end
  268. wa:remove()
  269. wait(1)
  270. pa.CFrame = CFrame.new(pa.Position, poz)
  271. wait(1)
  272. pa.Velocity = pa.CFrame.lookVector * 250
  273. end
  274. end)
  275. end
  276.  
  277. function desel()
  278. deselanim()
  279. end
  280.  
  281. --[[
  282. for i=0,30,5 do
  283. str1.C0 = CFrame.new(0,0,-i/22) * CFrame.Angles(math.rad(i),0,0)
  284. str2.C0 = CFrame.new(0,i/90,-i/22) * CFrame.Angles(math.rad(-i),0,0)
  285. ]]
  286. bin.Selected:connect(select)
  287. bin.Deselected:connect(desel)
  288.  
  289. -- lego
Add Comment
Please, Sign In to add comment