Advertisement
good_scripter

Untitled

Jun 28th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.40 KB | None | 0 0
  1. --Made pretty quickly kinda shat but I'm bored--
  2. local player = owner
  3. local char = player.Character
  4. local tor = char.Torso
  5. local mouse = player:GetMouse()
  6. local camera = game.Workspace.CurrentCamera
  7. local ra = char['Right Arm']
  8. local la = char['Left Arm']
  9. local ll = char['Left Leg']
  10. local rl = char['Right Leg']
  11.  
  12. function weld(p0,p1,c0)
  13. local w=Instance.new("Weld",p0)
  14. w.Part0=p0
  15. w.Part1=p1
  16. w.C0=c0
  17. return w
  18. end
  19.  
  20. function animate(part,speed,cframe,corout)
  21. coroutine.resume(coroutine.create(function()
  22. local startCFrame = part.Weld.C0
  23. local endCFrame = cframe
  24. for i = 0,1,speed do wait()
  25. part.Weld.C0 = startCFrame:lerp(endCFrame,i)
  26. end
  27. end))
  28. end
  29. function animate2(part,speed,cframe,corout)
  30. local startCFrame = part.Weld.C0
  31. local endCFrame = cframe
  32. for i = 0,1,speed do wait()
  33. part.Weld.C0 = startCFrame:lerp(endCFrame,i)
  34. end
  35. end
  36. function bleed(victim,speed,amount,velocity)
  37. coroutine.resume(coroutine.create(function()
  38. for i = 1,amount do wait(speed)
  39. local blood = Instance.new("Part",workspace)
  40. blood.CanCollide = false
  41. blood.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  42. blood.Transparency = 0
  43. blood.Anchored= false
  44. blood.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  45. blood.Material = Enum.Material.Metal
  46. blood.Size = Vector3.new(0.3, 0.3, 0.3)
  47. blood.Name = "blood"
  48. blood.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  49. blood.Position = victim.Position
  50. blood.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  51. blood.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  52. blood.BrickColor = BrickColor.new("Crimson")
  53. blood.Friction = 0.3
  54. blood.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  55. blood.Transparency = 0
  56.  
  57. if velocity == nil then
  58. blood.Velocity = victim.CFrame.lookVector * -30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
  59. end
  60. if velocity ~=nil then
  61. blood.Velocity = victim.CFrame.lookVector * velocity + Vector3.new(math.random(-10,10),20,math.random(-10,10))
  62. end
  63. blood.RotVelocity = Vector3.new(0,200,0)
  64.  
  65. blood.Touched:connect(function(h)
  66. if (not h:isDescendantOf(victim.Parent)) then
  67. if h.Name ~= "blood" and h.Name ~="puddle" and h.Name ~="Bolt" and h.Name ~="BoltFront" and h.Parent:FindFirstChild("Humanoid")==nil then
  68. local debounce = false
  69. if debounce == false then
  70. debounce = true
  71. print(h)
  72.  
  73. local puddle = Instance.new("Part", workspace)
  74. puddle.FormFactor = Enum.FormFactor.Plate
  75. puddle.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  76. puddle.Transparency = 0.3
  77. puddle.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  78. puddle.Anchored = false
  79. puddle.CanCollide = true
  80. puddle.Material = Enum.Material.Metal
  81. puddle.Size = Vector3.new(2, 0.1, 2)
  82. puddle.Name = "puddle"
  83. puddle.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  84. puddle.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  85. puddle.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  86. puddle.BrickColor = BrickColor.new("Crimson")
  87. puddle.Friction = 0.3
  88. puddle.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  89. puddle.Position = blood.Position
  90.  
  91. local mesh = Instance.new("CylinderMesh", puddle)
  92.  
  93. blood:Destroy()
  94. wait(1)
  95. puddle.Anchored = true
  96. puddle.CanCollide = false
  97. game.Debris:AddItem(puddle,8)
  98. coroutine.resume(coroutine.create(function()
  99. wait(.5)
  100. while puddle~=nil do wait(.5)
  101. puddle.Mesh.Scale = puddle.Mesh.Scale - Vector3.new(0,0,.1)
  102. puddle.Transparency = puddle.Transparency + .05
  103. end
  104. end))
  105.  
  106. end
  107. end
  108. end
  109. end)
  110.  
  111. end
  112.  
  113. end))
  114. end
  115.  
  116. local powergui = Instance.new("GuiMain", player.PlayerGui)
  117. powergui.Name = "PowerGui"
  118.  
  119. local tray = Instance.new("Frame", powergui)
  120. tray.Size = UDim2.new(0, 250, 0, 18)
  121. tray.SizeConstraint = Enum.SizeConstraint.RelativeYY
  122. tray.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
  123. tray.Name = "Tray"
  124. tray.Position = UDim2.new(0.5, -130, 1, -22)
  125. tray.BackgroundTransparency = 1
  126. tray.BackgroundColor3 = Color3.new(0.666667, 0, 0)
  127.  
  128. local background = Instance.new("TextBox", tray)
  129. background.FontSize = Enum.FontSize.Size14
  130. background.Active = false
  131. background.BorderSizePixel = 2
  132. background.BackgroundColor3 = Color3.new(0, 0, 0)
  133. background.Position = UDim2.new(0, 0, 0, -1)
  134. background.Size = UDim2.new(0, 253, 0, 21)
  135. background.BackgroundTransparency = 0.5
  136. background.BorderColor3 = Color3.new(0, 0, 0)
  137. background.Text = ""
  138. background.TextColor3 = Color3.new(1, 1, 1)
  139. background.Font = Enum.Font.SourceSans
  140. background.Name = "Background"
  141. background.ClearTextOnFocus = false
  142.  
  143. local bar = Instance.new("TextBox", tray)
  144. bar.FontSize = Enum.FontSize.Size14
  145. bar.Active = false
  146. bar.BorderSizePixel = 0
  147. bar.BackgroundColor3 = Color3.new(0, 0.333333, 0)
  148. bar.Position = UDim2.new(0.019, 0, 0.1, 0)
  149. bar.Size = UDim2.new(0.97, 0, 0.8, 0)
  150. bar.BackgroundTransparency = 0.25
  151. bar.BorderColor3 = Color3.new(1, 1, 1)
  152. bar.Text = ""
  153. bar.TextColor3 = Color3.new(1, 1, 1)
  154. bar.Font = Enum.Font.SourceSans
  155. bar.Name = "Bar"
  156. bar.ClearTextOnFocus = false
  157.  
  158. local powertext = Instance.new("TextBox", tray)
  159. powertext.FontSize = Enum.FontSize.Size14
  160. powertext.Active = false
  161. powertext.ZIndex = 3
  162. powertext.BorderSizePixel = 0
  163. powertext.BackgroundColor3 = Color3.new(0, 0.333333, 0)
  164. powertext.Position = UDim2.new(0.019, 0, 0.1, 0)
  165. powertext.Size = UDim2.new(0.97, 0, 0.8, 0)
  166. powertext.BackgroundTransparency = 1
  167. powertext.BorderColor3 = Color3.new(0, 0, 0)
  168. powertext.Text = "Power"
  169. powertext.TextColor3 = Color3.new(1, 1, 1)
  170. powertext.Font = Enum.Font.SourceSans
  171. powertext.Name = "Power"
  172. powertext.ClearTextOnFocus = false
  173.  
  174.  
  175.  
  176. ---Clothing------------------------------------------------------
  177. wait(1)
  178. if char:FindFirstChild("Shirt") then
  179. char.Shirt:Destroy()
  180. end
  181.  
  182. if char:FindFirstChild("Pants") then
  183. char.Pants:Destroy()
  184. end
  185.  
  186. if char:FindFirstChild("Shirt Graphic") then
  187. char["Shirt Graphic"]:Destroy()
  188. end
  189.  
  190. if char.Torso:FindFirstChild("roblox") then
  191. char.Torso.roblox:Destroy()
  192. end
  193.  
  194. local hid0r = char:GetChildren()
  195. for i=1, #hid0r do
  196. if (hid0r[i].className == "Accessory") then hid0r[i]:remove()
  197. end
  198. end
  199.  
  200. local Shirt = Instance.new("Shirt",char)
  201. Shirt.Name = "Shirt"
  202. local Pants = Instance.new("Pants",char)
  203. Pants.Name = "Pants"
  204. Shirt.ShirtTemplate = "rbxassetid://543661079"
  205. Pants.PantsTemplate = "rbxassetid://543662444"
  206.  
  207. local helmet = Instance.new("Part", char)
  208. helmet.FormFactor = Enum.FormFactor.Symmetric
  209. helmet.TopSurface = Enum.SurfaceType.Smooth
  210. helmet.Anchored = false
  211. helmet.Size = Vector3.new(1, 1, 1)
  212. helmet.Name = "Helmet"
  213. helmet.Friction = 0.3
  214. helmet.BottomSurface = Enum.SurfaceType.Smooth
  215.  
  216. mesh = Instance.new("SpecialMesh", helmet)
  217. mesh.MeshId = "rbxassetid://502620459"
  218. mesh.TextureId = "rbxassetid://502620602"
  219. mesh.MeshType = Enum.MeshType.FileMesh
  220. mesh.Scale = Vector3.new(0.08, 0.06, 0.06)
  221.  
  222. char.Head.BrickColor = BrickColor.new("Really black")
  223. if char.Head:FindFirstChild("face") then
  224. char.Head.face:Destroy()
  225. end
  226.  
  227. weld(helmet, char.Head, CFrame.new(0,-.1,-.1)*CFrame.Angles(math.rad(90),0,math.rad(0)))
  228. -----------------------------------------------------------------
  229. local handle = Instance.new("Part", char)
  230. handle.FormFactor = Enum.FormFactor.Plate
  231. handle.TopSurface = Enum.SurfaceType.Smooth
  232. handle.Size = Vector3.new(1, 0.4, 3)
  233. handle.Name = "Handle"
  234. handle.BrickColor = BrickColor.new("Institutional white")
  235. handle.Friction = 0.3
  236. handle.BottomSurface = Enum.SurfaceType.Smooth
  237. handle.CanCollide = false
  238.  
  239. mesh = Instance.new("SpecialMesh", handle)
  240. mesh.Scale = Vector3.new(0.6, 0.6, 0.6)
  241. mesh.MeshId = "http://www.roblox.com/asset/?id=15886761"
  242. mesh.TextureId = "http://www.roblox.com/asset/?id=15886781"
  243. mesh.MeshType = Enum.MeshType.FileMesh
  244.  
  245. weld(handle, tor, CFrame.new(0,.8,0)*CFrame.Angles(math.rad(90),0,math.rad(60)))
  246.  
  247. local sheaths = Instance.new("Sound")
  248. sheaths.SoundId="http://www.roblox.com/asset/?id=211134014"
  249. sheaths.PlayOnRemove=false
  250. sheaths.Volume=0.8
  251. sheaths.Looped=false
  252. sheaths.Pitch = 1
  253. sheaths.MaxDistance = 60
  254. sheaths.Parent=handle
  255.  
  256. local unsheaths = Instance.new("Sound")
  257. unsheaths.SoundId="http://www.roblox.com/asset/?id=609342907"
  258. unsheaths.PlayOnRemove=false
  259. unsheaths.Volume=0.8
  260. unsheaths.Looped=false
  261. unsheaths.Pitch = 1
  262. unsheaths.MaxDistance = 60
  263. unsheaths.Parent=handle
  264.  
  265. local reloadsound = Instance.new("Sound")
  266. reloadsound.SoundId="http://www.roblox.com/asset/?id=609345653"
  267. reloadsound.PlayOnRemove=false
  268. reloadsound.Volume=0.8
  269. reloadsound.Looped=false
  270. reloadsound.Pitch = 1
  271. reloadsound.MaxDistance = 60
  272. reloadsound.Parent=handle
  273.  
  274. local firesound = Instance.new("Sound")
  275. firesound.SoundId="http://www.roblox.com/asset/?id=609347009"
  276. firesound.PlayOnRemove=false
  277. firesound.Volume=0.8
  278. firesound.Looped=false
  279. firesound.Pitch = 1
  280. firesound.MaxDistance = 60
  281. firesound.Parent=handle
  282.  
  283. local vult = Instance.new("Sound")
  284. vult.SoundId="http://www.roblox.com/asset/?id=585548493"
  285. vult.PlayOnRemove=false
  286. vult.Volume=0.8
  287. vult.Looped=false
  288. vult.Pitch = 1
  289. vult.MaxDistance = 60
  290. vult.Parent=char.Head
  291.  
  292. local torso = char.Torso:Clone()
  293. torso.Size = Vector3.new(char.Torso.Size.x,char.Torso.Size.y,char.Torso.Size.z)
  294. torso.Transparency = 0
  295. torso.CanCollide = false
  296. if torso:FindFirstChild("roblox") then torso.roblox:Remove() end
  297. torso.Parent = char
  298. torso.CanCollide = true
  299. torso.Name = "Torso"
  300. torso["Left Shoulder"]:Destroy()
  301. torso["Right Shoulder"]:Destroy()
  302. torso["Left Hip"]:Destroy()
  303. torso["Right Hip"]:Destroy()
  304. char.Torso.Transparency = 1
  305. char.Torso.Name = "Torso2"
  306.  
  307.  
  308. local tweld = Instance.new("Weld",char.Torso)
  309. tweld.Name = "Weld"
  310. tweld.Part0 = char.Torso
  311. tweld.Part1 = char.Torso2
  312. tweld.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0)
  313. char.Torso2.Name = "Torso"
  314.  
  315.  
  316. function unsheath()
  317. tor["Right Shoulder"].Part1 = nil
  318. tor["Left Shoulder"].Part1 = nil
  319. weld(ra, tor, CFrame.new(-1.5,0,0)*CFrame.Angles(math.rad(0),0,0))
  320. weld(la, tor, CFrame.new(1.5,0,0)*CFrame.Angles(math.rad(0),math.rad(0),0))
  321. wait()
  322. animate(ra,.2,CFrame.new(-1.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  323. wait(.2)
  324. animate(ra,.2,CFrame.new(-1.5,-1,-.8)*CFrame.Angles(math.rad(-70),math.rad(-160),0))
  325. wait(.2)
  326. handle.Weld:Destroy()
  327. weld(handle, ra, CFrame.new(0,0,-1.4)*CFrame.Angles(math.rad(-180),math.rad(-90),math.rad(-90)))
  328. wait(.2)
  329. unsheaths:Play()
  330. animate(ra,.2,CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(-90),math.rad(-10),0))
  331. animate(la,.2,CFrame.new(-.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  332. handle.Weld.C0 = CFrame.new(0,-.4,-.8)*CFrame.Angles(math.rad(-90),math.rad(180),math.rad(0))
  333. end
  334.  
  335. function sheathe()
  336. animate(ra,.2,CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(-90),math.rad(-20),0))
  337. animate(la,.2,CFrame.new(1.5,0,0)*CFrame.Angles(math.rad(0),math.rad(0),0))
  338. wait()
  339. animate(ra,.2,CFrame.new(-1.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  340. wait(.2)
  341. animate(ra,.2,CFrame.new(-1.5,-1,-.8)*CFrame.Angles(math.rad(-70),math.rad(-160),0))
  342. wait(.2)
  343. sheaths:Play()
  344. handle.Weld:Destroy()
  345. weld(handle, tor, CFrame.new(0,.8,0)*CFrame.Angles(math.rad(90),0,math.rad(60)))
  346. wait(.2)
  347. animate(ra,.2,CFrame.new(-1.5,0,0)*CFrame.Angles(math.rad(0),math.rad(0),0))
  348. wait(.2)
  349. if la:FindFirstChild("Weld") then la.Weld:Destroy() end
  350. tor["Left Shoulder"].Part1 = la
  351. if ra:FindFirstChild("Weld") then ra.Weld:Destroy() end
  352. tor["Right Shoulder"].Part1 = ra
  353. if rl:FindFirstChild("Weld") then rl.Weld:Destroy() end
  354. tor["Right Hip"].Part1 = rl
  355. end
  356.  
  357. fpressed = 0
  358. mouse.KeyDown:connect(function(key)
  359. if key == "f" then
  360. fpressed = fpressed + 1
  361. if fpressed == 1 then
  362. unsheath()
  363. end
  364. if fpressed == 2 then
  365. fpressed = 0
  366. sheathe()
  367. end
  368. end
  369. end)
  370.  
  371. local ammo = 0
  372. local cooldown = false
  373. function reload()
  374. cooldown = true
  375. weld(char.Head, torso, CFrame.new(0,-1.5,0)*CFrame.Angles(math.rad(0),0,0))
  376. char.Head.Weld.Name = "Weld2"
  377. animate(torso,.2,CFrame.new(0,0,.3)*CFrame.Angles(math.rad(20),math.rad(0),0))
  378. animate(ra,.2,CFrame.new(-1.5,1.5,0)*CFrame.Angles(math.rad(-20),math.rad(-10),0))
  379. animate(la,.2,CFrame.new(-.5,2,0)*CFrame.Angles(math.rad(-20),math.rad(0),0))
  380. wait(.2)
  381. animate(la,.2,CFrame.new(-.5,2,.5)*CFrame.Angles(math.rad(-20),math.rad(0),0))
  382. wait(.2)
  383. animate(la,.2,CFrame.new(-.5,2,.5)*CFrame.Angles(math.rad(-30),math.rad(20),0))
  384. wait(.2)
  385. reloadsound:Play()
  386. animate(la,.2,CFrame.new(-.5,1.5,.5)*CFrame.Angles(math.rad(-30),math.rad(20),0))
  387. wait(.4)-- wait(.6)
  388. animate(la,.2,CFrame.new(-.5,2,.5)*CFrame.Angles(math.rad(-30),math.rad(20),0))
  389. local boltmodel = Instance.new("Model",char)
  390. boltmodel.Name = "BoltModel"
  391. local bolt = Instance.new("Part", boltmodel)
  392. bolt.FormFactor = Enum.FormFactor.Plate
  393. bolt.TopSurface = Enum.SurfaceType.Smooth
  394. bolt.Velocity = Vector3.new(-0.001, -0.006, -0.001)
  395. bolt.RotVelocity = Vector3.new(0, 0, -0.003)
  396. bolt.Size = Vector3.new(1, 0.4, 2)
  397. bolt.Name = "Bolt"
  398. bolt.CanCollide = false
  399. bolt.Anchored = false
  400. bolt.BrickColor = BrickColor.new("Dark stone grey")
  401. bolt.Friction = 0.3
  402. bolt.BottomSurface = Enum.SurfaceType.Smooth
  403. mesh = Instance.new("SpecialMesh", bolt)
  404. mesh.MeshId = "http://www.roblox.com/asset/?id=15887356"
  405. mesh.TextureId = "http://www.roblox.com/asset/?id=15886781"
  406. mesh.MeshType = Enum.MeshType.FileMesh
  407. local attach1 = Instance.new("Attachment",bolt)
  408. attach1.Name = "Attachment0"
  409. attach1.Position = Vector3.new(0,0,0)
  410.  
  411. local attach2 = Instance.new("Attachment",bolt)
  412. attach2.Name = "Attachment1"
  413. attach2.Position = Vector3.new(0,0,.1)
  414.  
  415. local trail = Instance.new("Trail",bolt)
  416. trail.Attachment0 = attach1
  417. trail.Attachment1 = attach2
  418. trail.Lifetime = 1
  419. trail.Enabled = false
  420.  
  421. local boltfront = Instance.new("Part", boltmodel)
  422. boltfront.CanCollide = false
  423. boltfront.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  424. boltfront.Transparency = 1
  425. boltfront.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  426. boltfront.Material = Enum.Material.Metal
  427. boltfront.Size = Vector3.new(0.2, 0.2, 2)
  428. boltfront.Name = "BoltFront"
  429. boltfront.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  430. boltfront.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  431. boltfront.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  432. boltfront.BrickColor = BrickColor.new("Really black")
  433. boltfront.Friction = 0.3
  434. boltfront.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  435.  
  436. weld(bolt, handle, CFrame.new(0,-.2,0)*CFrame.Angles(math.rad(0),0,math.rad(0)))
  437. weld(boltfront, bolt, CFrame.new(0,0,0)*CFrame.Angles(math.rad(180),0,math.rad(0)))
  438. --bolt.Weld.Name = "Weld2"
  439.  
  440. --return--
  441. wait(.2)
  442. animate(la,.2,CFrame.new(-.5,2,.5)*CFrame.Angles(math.rad(-20),math.rad(0),0))
  443. wait(.2)
  444. animate(la,.2,CFrame.new(-.5,2,0)*CFrame.Angles(math.rad(-20),math.rad(0),0))
  445. wait(.2)
  446. animate(torso,.2,CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),0))
  447. animate(ra,.2,CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(-90),math.rad(-10),0))
  448. animate(la,.2,CFrame.new(-.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  449. wait(.2)
  450. if char.Head:FindFirstChild("Weld") then char.Head.Weld:Destroy() end
  451. --tor["Neck"].Part1 = char.Head
  452. ammo = 1
  453. cooldown = false
  454. end
  455.  
  456. mouse.KeyDown:connect(function(key)
  457. if key == "r" and ammo <=0 and cooldown == false and fpressed == 1 then
  458. reload()
  459. end
  460. end)
  461.  
  462.  
  463. function taunt()
  464. cooldown = true
  465. animate(la,.2,CFrame.new(1.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  466. wait(.2)
  467. animate(la,.2,CFrame.new(1.5,1.2,0)*CFrame.Angles(math.rad(-90),math.rad(20),0))
  468. vult:Play()
  469. wait(1)
  470. animate(la,.2,CFrame.new(1.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  471. wait(.5)
  472. animate(la,.2,CFrame.new(-.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  473. cooldown = false
  474. end
  475.  
  476. mouse.KeyDown:connect(function(key)
  477. if key == "t" and cooldown == false and fpressed == 1 then
  478. taunt()
  479. end
  480. end)
  481.  
  482. local power = 0
  483. local maxpower = 300
  484. powertext.Text = "Power: ["..power.. "]/["..maxpower.."]"
  485. bar:TweenSize(UDim2.new(.97/(maxpower/power), 0, .8, 0), "InOut", "Quad", 1)
  486. function fire()
  487. cooldown = true
  488. firesound:Play()
  489. animate(ra,.2,CFrame.new(-1.5,-.5,0)*CFrame.Angles(math.rad(-90),math.rad(-10),0))
  490. animate(la,.2,CFrame.new(-.5,0,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  491. local BoltModel = char.BoltModel
  492. local bolt = char.BoltModel.Bolt
  493. local boltfront = char.BoltModel.BoltFront
  494. bolt.Trail.Enabled = true
  495. bolt.Weld:Destroy()
  496. bolt.CanCollide = false
  497. BoltModel.Parent = workspace
  498. game.Debris:AddItem(BoltModel,10)
  499. --bolt.Velocity = mouse.Hit.lookVector*300
  500. local Unit = (mouse.Hit.p - handle.Position).unit
  501. local bvelocity = Instance.new("BodyVelocity",bolt)
  502. bvelocity.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  503. bvelocity.velocity = Unit*power
  504. local bg = Instance.new('BodyGyro', bolt)
  505. bg.Name = 'Gyro'
  506. bg.CFrame = CFrame.new(-handle.CFrame.p, -mouse.Hit.p)
  507. bg.maxTorque= Vector3.new(math.huge, math.huge, math.huge)
  508. local debounce = false
  509. boltfront.Touched:connect(function(h)
  510. if (not h:isDescendantOf(char)) then
  511. if debounce == false then
  512. debounce = true
  513. if h.Name == "Hat" or h.Name == "Accessory" or h.Name == "Handle" then
  514. h:Destroy()
  515. end
  516. print(h)
  517. if h.Parent:FindFirstChild("Humanoid") then
  518. local hum = h.Parent.Humanoid
  519. hum:TakeDamage(power/4)
  520. bleed(h,0,1)
  521. bvelocity:Destroy()
  522. bg:Destroy()
  523.  
  524. local weld = Instance.new("Weld")
  525.  
  526. weld.Part0 = boltfront
  527. weld.Part1 = h
  528.  
  529. -- correction term to account for average skew between physics update and heartbeat
  530. local HitPos = boltfront.Position --+ (-arrow.Velocity * (1/60)) --+ (arrow.CFrame.lookVector * .5)
  531.  
  532. local CJ = CFrame.new(HitPos)
  533. local C0 = boltfront.CFrame:inverse() *CJ
  534. local C1 = h.CFrame:inverse() * CJ
  535.  
  536. weld.C0 = C0
  537. weld.C1 = C1
  538.  
  539. weld.Parent = boltfront
  540. if bolt:FindFirstChild("Trail") then
  541. bolt.Trail:Destroy()
  542. end
  543.  
  544. local hitsound = Instance.new("Sound")
  545. hitsound.SoundId="rbxassetid://566593606"
  546. hitsound.PlayOnRemove=false
  547. hitsound.Volume=.5
  548. hitsound.MaxDistance = 60
  549. hitsound.Looped=false
  550. hitsound.Pitch = 1
  551. hitsound.Parent=bolt
  552. hitsound:Play()
  553. game.Debris:AddItem(hitsound,1)
  554.  
  555. else
  556. bvelocity:Destroy()
  557. bg:Destroy()
  558. local weld = Instance.new("Weld")
  559.  
  560. weld.Part0 = boltfront
  561. weld.Part1 = h
  562.  
  563. -- correction term to account for average skew between physics update and heartbeat
  564. local HitPos = bolt.Position --+ (-arrow.Velocity * (1/60)) --+ (arrow.CFrame.lookVector * .5)
  565.  
  566. local CJ = CFrame.new(HitPos)
  567. local C0 = boltfront.CFrame:inverse() *CJ
  568. local C1 = h.CFrame:inverse() * CJ
  569.  
  570. weld.C0 = C0
  571. weld.C1 = C1
  572.  
  573. weld.Parent = boltfront
  574. if bolt:FindFirstChild("Trail") then
  575. bolt.Trail:Destroy()
  576. end
  577.  
  578. local hitsound = Instance.new("Sound")
  579. hitsound.SoundId="rbxassetid://743521337"
  580. hitsound.PlayOnRemove=false
  581. hitsound.Volume=.5
  582. hitsound.MaxDistance = 60
  583. hitsound.Looped=false
  584. hitsound.Pitch = 1
  585. hitsound.Parent=bolt
  586. hitsound:Play()
  587. game.Debris:AddItem(hitsound,1)
  588. game.Debris:AddItem(bolt,5)
  589. end
  590. end
  591. end
  592. end)
  593.  
  594. wait(.2)
  595. animate(ra,.2,CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(-90),math.rad(-10),0))
  596. animate(la,.2,CFrame.new(-.5,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),0))
  597. ammo = 0
  598. cooldown = false
  599. end
  600.  
  601. function aim()
  602. animate(la,.2,CFrame.new(-.5,.9,0)*CFrame.Angles(math.rad(-90),math.rad(10),0))
  603. end
  604.  
  605. local mousedown = false
  606. mouse.Button1Down:connect(function()
  607. if fpressed == 1 and ammo >=1 and cooldown == false then
  608. mousedown = true
  609. aim()
  610. end
  611. while mousedown== true and power<maxpower do wait(.1)
  612. power = power + 20
  613. powertext.Text = "Power: ["..power.. "]/["..maxpower.."]"
  614. bar:TweenSize(UDim2.new(.97/(maxpower/power), 0, .8, 0), "InOut", "Quad", 1)
  615. end
  616. end)
  617.  
  618. mouse.Button1Up:connect(function()
  619. if fpressed == 1 and ammo >=1 and cooldown == false then
  620. mousedown = false
  621. fire()
  622. power = 0
  623. powertext.Text = "Power: ["..power.. "]/["..maxpower.."]"
  624. bar:TweenSize(UDim2.new(.97/(maxpower/power), 0, .8, 0), "InOut", "Quad", 1)
  625. end
  626. end)
  627.  
  628. --Health--
  629. wait()
  630. char.Humanoid.MaxHealth = 450
  631. wait()
  632. char.Humanoid.Health = 450
  633. ----------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement