Advertisement
vibrantsinger423

borg

Apr 17th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.28 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/60) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. Player = owner
  85. local unlocks = Instance.new("StringValue")
  86. unlocks.Name = "Unlocks"
  87. unlocks.Parent = Player
  88. unlocks.Value = "Yumigari Ammo+"
  89. Character = Player.Character
  90. PlayerGui = Player.PlayerGui
  91. Backpack = Player.Backpack
  92. Torso = Character.Torso
  93. Head = Character.Head
  94. LeftArm = Character["Left Arm"]
  95. LeftLeg = Character["Left Leg"]
  96. RightArm = Character["Right Arm"]
  97. RightLeg = Character["Right Leg"]
  98. LS = Torso["Left Shoulder"]
  99. LH = Torso["Left Hip"]
  100. RS = Torso["Right Shoulder"]
  101. RH = Torso["Right Hip"]
  102. local p = owner
  103. ModelName = "Weapon"
  104. attack = false
  105. attacktype = 1
  106. Hitdeb = 0
  107. Neck = Torso.Neck
  108. local neckcf0 = Neck.C0
  109. ----------------------------
  110. --Customize
  111. Ammo = 100
  112. if (string.match(Player.Unlocks.Value,"Yumigari Ammo+") ~= nil) then
  113. MaxAmmo = 100
  114. else
  115. MaxAmmo = 100
  116. end
  117. mindamage = 1000
  118. maxdamage = 100000
  119. crtmaxdamage = 99999999
  120. omindamage = mindamage
  121. omaxdamage = maxdamage
  122. ocrtmaxdamage = crtmaxdamage
  123. crtrate = 100/40
  124. --100%/critpercentage
  125. oblkbrkr = 0
  126. blockbreaker = oblkbrkr
  127. spread = 1.3
  128. spread = spread*300
  129. Ammoregen = 100
  130. if (string.match(Player.Unlocks.Value,"Yumigari Range+") ~= nil) then
  131. range = 500
  132. else
  133. range = 500
  134. end
  135. rangepower = 100
  136. CurrentArrow = "Fire"
  137. handlecolor = BrickColor.new("Brown")
  138. bcolor = BrickColor.new("Really red")
  139. gemcolor = BrickColor.new("Black")
  140. arrowtrail = BrickColor.new("Really red")
  141. ToolName = "Bow test"
  142. BowMeterial = "Neon"
  143. ---------------------------------------------------------------------------------------------------------------------------------------
  144. if Character:findFirstChild("EquippedVal",true) ~= nil then
  145. Character:findFirstChild("EquippedVal",true).Parent = nil
  146. end
  147. ev = Instance.new("BoolValue",Character)
  148. ev.Name = "EquippedVal"
  149. ev.Value = false
  150. if Character:findFirstChild("Block",true) ~= nil then
  151. Character:findFirstChild("Block",true).Parent = nil
  152. end
  153. --player
  154. player = nil
  155. --welds
  156. RW, LW , RWL, LWL = Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld")
  157. --what anim
  158. anim = "none"
  159. --other var
  160. player = Player
  161. ch = Character
  162. --save shoulders
  163. AoETrue = {}
  164. RSH, LSH , RHL, LHL = ch.Torso["Right Shoulder"], ch.Torso["Left Shoulder"] , ch.Torso["Right Hip"] , ch.Torso["Left Hip"]
  165. function RWFunc()
  166. RW.Part1 = ch["Right Arm"]
  167. RSH.Part1 = nil
  168. end
  169. function LWFunc()
  170. LW.Part1 = ch["Left Arm"]
  171. LSH.Part1 = nil
  172. end
  173. function RWLFunc()
  174. RWL.Part1 = ch["Right Leg"]
  175. RHL.Part1 = nil
  176. ch["Right Leg"].Name = "RightLeg"
  177. RightLeg.CanCollide = false
  178. end
  179. function LWLFunc()
  180. LWL.Part1 = ch["Left Leg"]
  181. LHL.Part1 = nil
  182. ch["Left Leg"].Name = "LeftLeg"
  183. LeftLeg.CanCollide = true
  184. end
  185. function RWLRem()
  186. RightLeg.Name = "Right Leg"
  187. RWL.Part1 = nil
  188. RHL.Part1 = ch["Right Leg"]
  189. RightLeg.CanCollide = false
  190. end
  191. function LWLRem()
  192. LeftLeg.Name = "Left Leg"
  193. LWL.Part1 = nil
  194. LHL.Part1 = ch["Left Leg"]
  195. LeftLeg.CanCollide = false
  196. end
  197. function RWRem()
  198. RW.Part1 = nil
  199. RSH.Part1 = ch["Right Arm"]
  200. end
  201. function LWRem()
  202. LW.Part1 = nil
  203. LSH.Part1 = ch["Left Arm"]
  204. end
  205. if Character:findFirstChild(ModelName,true) ~= nil then
  206. Character:findFirstChild(ModelName,true).Parent = nil
  207. RHL.Part1 = ch["Right Leg"]
  208. LHL.Part1 = ch["Left Leg"]
  209. RSH.Part1 = ch["Right Arm"]
  210. LSH.Part1 = ch["Left Arm"]
  211. end
  212. local swordholder = Instance.new("Model")
  213. swordholder.Name = ModelName
  214. swordholder.Parent = Character
  215. --derp
  216. RW.Part0 = ch.Torso
  217. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  218. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  219. RW.Parent = swordholder
  220. --
  221. LW.Part0 = ch.Torso
  222. LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  223. LW.C1 = CFrame.new(0, 0.5, 0)
  224. LW.Parent = swordholder
  225. --
  226. RWL.Part0 = ch.Torso
  227. RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
  228. RWL.C1 = CFrame.new(0.5, 1, 0)
  229. RWL.Parent = swordholder
  230. --
  231. LWL.Part0 = ch.Torso
  232. LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
  233. LWL.C1 = CFrame.new(-0.5, 1, 0)
  234. LWL.Parent = swordholder
  235. local msh1 = Instance.new("CylinderMesh")
  236. msh1.Scale = Vector3.new(1,1,1)
  237. local msh2 = Instance.new("CylinderMesh")
  238. msh2.Scale = Vector3.new(1,1,1)
  239. local msh3 = Instance.new("CylinderMesh")
  240. msh3.Scale = Vector3.new(1,1,1)
  241. local msh4 = Instance.new("BlockMesh")
  242. msh4.Scale = Vector3.new(2.5,1.2,1.2)
  243. local msh5 = Instance.new("BlockMesh")
  244. msh5.Scale = Vector3.new(2.5,1.2,1.2)
  245. local msh6 = Instance.new("BlockMesh")
  246. msh6.Scale = Vector3.new(1,1,1)
  247. local msh7 = Instance.new("BlockMesh")
  248. msh7.Scale = Vector3.new(1,1,1)
  249. local msh8 = Instance.new("SpecialMesh")
  250. msh8.MeshId = "http://www.roblox.com/asset/?id=3270017"
  251. msh8.Scale = Vector3.new(1,1,30)
  252. local msh9 = Instance.new("BlockMesh")
  253. local torsc = false
  254. for i,z in pairs(Character:GetChildren()) do
  255. if z.className == "CharacterMesh" then
  256. if z.BodyPart == Enum.BodyPart.Torso then
  257. torsc = true
  258. end
  259. end
  260. end
  261. if torsc then
  262. msh9 = Instance.new("SpecialMesh")
  263. msh9.MeshId = "http://www.roblox.com/asset/?id=3270017"
  264. msh9.Scale = Vector3.new(2.01,1,1.01)
  265. else
  266. msh9 = Instance.new("BlockMesh")
  267. msh9.Scale = Vector3.new(2.01,0.1,1.01)
  268. end
  269. local msh10 = Instance.new("CylinderMesh")
  270. msh10.Scale = Vector3.new(1,1,1)
  271. local prt1 = Instance.new("Part")
  272. prt1.formFactor = 3
  273. prt1.CanCollide = false
  274. prt1.Name = "Handle"
  275. prt1.Locked = true
  276. prt1.Size = Vector3.new(0.3,3,0.3)
  277. prt1.Parent = swordholder
  278. msh1.Parent = prt1
  279. prt1.BrickColor = handlecolor
  280. prt1.Material = BowMeterial
  281. local prt2 = Instance.new("Part")
  282. prt2.formFactor = 3
  283. prt2.CanCollide = false
  284. prt2.Name = "Handle2"
  285. prt2.Locked = true
  286. prt2.Size = Vector3.new(0.3,1,0.3)
  287. prt2.Parent = swordholder
  288. msh2.Parent = prt2
  289. prt2.BrickColor = handlecolor
  290. prt2.Material = BowMeterial
  291. local prt3 = Instance.new("Part")
  292. prt3.formFactor = 3
  293. prt3.CanCollide = false
  294. prt3.Name = "Handle3"
  295. prt3.Locked = true
  296. prt3.Size = Vector3.new(0.3,1,0.3)
  297. prt3.Parent = swordholder
  298. msh3.Parent = prt3
  299. prt3.BrickColor = handlecolor
  300. prt3.Material = BowMeterial
  301. local prt4 = Instance.new("Part")
  302. prt4.formFactor = 3
  303. prt4.CanCollide = false
  304. prt4.Name = "Handle4"
  305. prt4.Locked = true
  306. prt4.Size = Vector3.new(0.3,2,0.3)
  307. prt4.Parent = swordholder
  308. msh4.Parent = prt4
  309. prt4.BrickColor = bcolor
  310. prt4.Material = BowMeterial
  311. local prt5 = Instance.new("Part")
  312. prt5.formFactor = 3
  313. prt5.CanCollide = false
  314. prt5.Name = "Handle5"
  315. prt5.Locked = true
  316. prt5.Size = Vector3.new(0.3,2,0.3)
  317. prt5.Parent = swordholder
  318. msh5.Parent = prt5
  319. prt5.BrickColor = bcolor
  320. prt5.Material = BowMeterial
  321. local prt6 = Instance.new("Part")
  322. prt6.formFactor = 3
  323. prt6.CanCollide = false
  324. prt6.Name = "Handle6"
  325. prt6.Locked = true
  326. prt6.Size = Vector3.new(1,2,0.3)
  327. prt6.Parent = swordholder
  328. msh6.Parent = prt6
  329. prt6.BrickColor = bcolor
  330. prt6.Material = BowMeterial
  331. local prt7 = Instance.new("Part")
  332. prt7.formFactor = 3
  333. prt7.CanCollide = false
  334. prt7.Name = "Handle7"
  335. prt7.Locked = true
  336. prt7.Size = Vector3.new(1,2,0.3)
  337. prt7.Parent = swordholder
  338. msh7.Parent = prt7
  339. prt7.BrickColor = bcolor
  340. prt7.Material = BowMeterial
  341. local prt8 = Instance.new("Part")
  342. prt8.formFactor = 3
  343. prt8.CanCollide = false
  344. prt8.Name = "Quiver"
  345. prt8.Locked = true
  346. prt8.Size = Vector3.new(1.25,2.25,1.25)
  347. prt8.Parent = swordholder
  348. msh8.Parent = prt8
  349. prt8.BrickColor = handlecolor
  350. prt8.Material = BowMeterial
  351. local prt9 = Instance.new("Part")
  352. prt9.formFactor = 3
  353. prt9.CanCollide = false
  354. prt9.Name = "QuiverStrap"
  355. prt9.Locked = true
  356. prt9.Size = Vector3.new(1,1,1)
  357. prt9.Parent = swordholder
  358. msh9.Parent = prt9
  359. prt9.BrickColor = handlecolor
  360. prt9.Material = BowMeterial
  361. local prt10 = Instance.new("Part")
  362. prt10.formFactor = 3
  363. prt10.CanCollide = false
  364. prt10.Name = "QuiverCover"
  365. prt10.Locked = true
  366. prt10.Size = Vector3.new(1,0.2,1)
  367. prt10.Parent = swordholder
  368. msh10.Parent = prt10
  369. prt10.BrickColor = handlecolor
  370. prt10.Material = BowMeterial
  371. local msh11 = Instance.new("SpecialMesh")
  372. msh11.MeshId = "http://www.roblox.com/asset/?id=15887356"
  373. msh11.TextureId = "http://www.roblox.com/asset/?id=15886781"
  374. msh11.Scale = Vector3.new(1,1,2.5)
  375. local prt11 = Instance.new("Part")
  376. prt11.formFactor = 3
  377. prt11.CanCollide = false
  378. prt11.Name = "Arrow"
  379. prt11.Locked = true
  380. prt11.Size = Vector3.new(0.2,0.2,2.5)
  381. prt11.Parent = swordholder
  382. msh11.Parent = prt11
  383. prt11.Material = BowMeterial
  384. local w11 = Instance.new("Weld")
  385. w11.Parent = prt11
  386. w11.Part0 = prt11
  387. w11.Part1 = LeftArm
  388. w11.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  389. w11.C0 = CFrame.Angles(0,0,math.rad(90)) * CFrame.new(0,1,0)
  390. coroutine.resume(coroutine.create(function()
  391. repeat
  392. wait(0.25)
  393. if Ammo > 0 then
  394. prt11.Transparency = 0
  395. else
  396. prt11.Transparency = 1
  397. end
  398. until false
  399. end))
  400. for i = 1,10 do
  401. local msh0 = Instance.new("SpecialMesh")
  402. msh0.MeshId = "http://www.roblox.com/asset/?id=15887356"
  403. msh0.TextureId = "http://www.roblox.com/asset/?id=15886781"
  404. msh0.Scale = Vector3.new(1,1,2.5)
  405. local prt0 = Instance.new("Part")
  406. prt0.formFactor = 3
  407. prt0.CanCollide = false
  408. prt0.Name = "Arrow"..i
  409. prt0.Locked = true
  410. prt0.Size = Vector3.new(0.2,0.2,2.5)
  411. prt0.Parent = swordholder
  412. msh0.Parent = prt0
  413. local w0 = Instance.new("Weld")
  414. w0.Parent = prt0
  415. w0.Part0 = prt0
  416. w0.Part1 = prt8
  417. w0.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  418. w0.C0 = CFrame.Angles(math.rad(180), 0,math.rad(360*math.random())) * CFrame.new(math.random(-25,25)/100, math.random(-25,25)/100,-0.315)
  419. end
  420. ---
  421. local String1 = Instance.new("Part")
  422. String1.formFactor = 3
  423. String1.CanCollide = false
  424. String1.Name = "String1"
  425. String1.Locked = true
  426. String1.Anchored = true
  427. String1.Size = Vector3.new(0.2,4,0.2)
  428. String1.Parent = swordholder
  429. String1.BrickColor = BrickColor.new("White")
  430. local strmsh1 = Instance.new("BlockMesh",String1)
  431. strmsh1.Scale = Vector3.new(0.25,1,0.25)
  432. local String2 = Instance.new("Part")
  433. String2.formFactor = 3
  434. String2.CanCollide = false
  435. String2.Name = "String2"
  436. String2.Locked = true
  437. String2.Anchored = true
  438. String2.Size = Vector3.new(0.2,4,0.2)
  439. String2.Parent = swordholder
  440. String2.BrickColor = BrickColor.new("White")
  441. local strmsh2 = Instance.new("BlockMesh",String2)
  442. strmsh2.Scale = Vector3.new(0.25,1,0.25)
  443. local strmdl = "Bow"
  444. coroutine.resume(coroutine.create(function()
  445. repeat
  446. wait(0.1)
  447. local top = prt4.CFrame*CFrame.new(0,prt4.Size.y/-2,0)
  448. local bottom = prt5.CFrame*CFrame.new(0,prt5.Size.y/2,0)
  449. local oristrpos
  450. if strmdl == "Bow" then
  451. oristrpos = CFrame.new((top.p+bottom.p)/2)
  452. elseif strmdl == "TopArm" then
  453. oristrpos = RightArm.CFrame * CFrame.new(0,RightArm.Size.y/2,0)
  454. elseif strmdl == "LeftArm" then
  455. oristrpos = LeftArm.CFrame * CFrame.new(0,RightArm.Size.y/-2,0)
  456. end
  457. local mg1 = (top.p - oristrpos.p).magnitude
  458. local mg2 = (bottom.p - oristrpos.p).magnitude
  459. String1.Size = Vector3.new(0.2,mg1,0.2)
  460. String1.CFrame = CFrame.new((top.p+oristrpos.p)/2,oristrpos.p) * CFrame.Angles(math.rad(90),0,0)
  461. String2.Size = Vector3.new(0.2,mg2,0.2)
  462. String2.CFrame = CFrame.new((bottom.p+oristrpos.p)/2,oristrpos.p) * CFrame.Angles(math.rad(90),0,0)
  463. until false
  464. end))
  465. local w1 = Instance.new("Weld")
  466. w1.Parent = prt1
  467. w1.Part0 = prt1
  468. local w2 = Instance.new("Weld")
  469. w2.Parent = prt2
  470. w2.Part0 = prt2
  471. w2.Part1 = prt1
  472. w2.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  473. w2.C0 = CFrame.Angles(math.rad(20), 0, 0) * CFrame.new(0, 1.9,-0.15)
  474. local w3 = Instance.new("Weld")
  475. w3.Parent = prt3
  476. w3.Part0 = prt3
  477. w3.Part1 = prt1
  478. w3.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  479. w3.C0 = CFrame.Angles(math.rad(-20), 0, 0) * CFrame.new(0, -1.9,-0.15)
  480. local w4 = Instance.new("Weld")
  481. w4.Parent = prt4
  482. w4.Part0 = prt4
  483. w4.Part1 = prt1
  484. w4.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  485. w4.C0 = CFrame.Angles(math.rad(-55), 0, 0) * CFrame.new(0, 2.85,0.4)
  486. local w5 = Instance.new("Weld")
  487. w5.Parent = prt5
  488. w5.Part0 = prt5
  489. w5.Part1 = prt1
  490. w5.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  491. w5.C0 = CFrame.Angles(math.rad(55), 0, 0) * CFrame.new(0, -2.85,0.4)
  492. local w6 = Instance.new("Weld")
  493. w6.Parent = prt6
  494. w6.Part0 = prt6
  495. w6.Part1 = prt1
  496. w6.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  497. w6.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.6,0)
  498. local w7 = Instance.new("Weld")
  499. w7.Parent = prt7
  500. w7.Part0 = prt7
  501. w7.Part1 = prt1
  502. w7.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  503. w7.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, -0.6,0)
  504. local w8 = Instance.new("Weld")
  505. w8.Parent = prt8
  506. w8.Part0 = prt8
  507. w8.Part1 = Torso
  508. w8.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  509. w8.C0 = CFrame.Angles(math.rad(90), 0, math.rad(-80)) * CFrame.new(0, 0.9,-1)
  510. local w9 = Instance.new("Weld")
  511. w9.Parent = prt9
  512. w9.Part0 = prt9
  513. w9.Part1 = Torso
  514. w9.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  515. if torsc then
  516. w9.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 1,0)
  517. else
  518. w9.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 1,0)
  519. end
  520. local w10 = Instance.new("Weld")
  521. w10.Parent = prt10
  522. w10.Part0 = prt10
  523. w10.Part1 = prt8
  524. w10.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
  525. w10.C0 = CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) * CFrame.new(0, 0,2.3)
  526.  
  527. local RAP = Instance.new("Part")
  528. RAP.formFactor = 0
  529. RAP.CanCollide = false
  530. RAP.Name = "RAPart"
  531. RAP.Locked = true
  532. RAP.Size = Vector3.new(1,1,1)
  533. RAP.Parent = swordholder
  534. RAP.Transparency = 1
  535. local w = Instance.new("Weld")
  536. w.Parent = RAP
  537. w.Part0 = RAP
  538. w.Part1 = RightArm
  539. w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
  540. w.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) * CFrame.new(0, 1, 0)
  541. function unequipweld()
  542. w1.Part1 = Torso
  543. w1.C1 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), math.rad(0)) * CFrame.new(0, 0,0)
  544. w1.C0 = CFrame.fromEulerAnglesXYZ(math.rad(180),math.rad(180), math.rad(0)) * CFrame.new(-1.15, -0.5, -0.6)
  545. end
  546. unequipweld()
  547. function equipweld()
  548. w1.Part0 = prt1
  549. w1.Part1 = RAP
  550. w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
  551. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  552. end
  553. function ss(parent,p) --Slash
  554. local SlashSound = Instance.new("Sound")
  555. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  556. SlashSound.Parent = parent
  557. SlashSound.Volume = .7
  558. SlashSound.Pitch = p
  559. SlashSound.PlayOnRemove = true
  560. coroutine.resume(coroutine.create(function()
  561. wait()
  562. SlashSound.Parent = nil
  563. end))
  564. end
  565. function uss(parent,p) --unsheath
  566. local SlashSound = Instance.new("Sound")
  567. SlashSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  568. SlashSound.Parent = parent
  569. SlashSound.Volume = .7
  570. SlashSound.Pitch = p
  571. SlashSound.PlayOnRemove = true
  572. coroutine.resume(coroutine.create(function()
  573. wait()
  574. SlashSound.Parent = nil
  575. end))
  576. end
  577. function cs(parent,p) --Magic Charge
  578. local SlashSound = Instance.new("Sound")
  579. SlashSound.SoundId = "http://www.roblox.com/asset/?id=2101137"
  580. SlashSound.Parent = parent
  581. SlashSound.Volume = .7
  582. SlashSound.Pitch = p
  583. SlashSound.PlayOnRemove = true
  584. coroutine.resume(coroutine.create(function()
  585. wait()
  586. SlashSound.Parent = nil
  587. end))
  588. end
  589. function ls(parent,p) --Lazer Sound
  590. local SlashSound = Instance.new("Sound")
  591. SlashSound.SoundId = "http://www.roblox.com/asset?id=1369158"
  592. SlashSound.Parent = parent
  593. SlashSound.Volume = .7
  594. SlashSound.Pitch = p
  595. SlashSound.PlayOnRemove = true
  596. coroutine.resume(coroutine.create(function()
  597. wait()
  598. SlashSound.Parent = nil
  599. end))
  600. end
  601. function ts(parent,p)
  602. local SlashSound = Instance.new("Sound")
  603. SlashSound.SoundId = "http://www.roblox.com/asset/?id=12222030"
  604. SlashSound.Parent = parent
  605. SlashSound.Volume = .7
  606. SlashSound.Pitch = p
  607. SlashSound.PlayOnRemove = true
  608. coroutine.resume(coroutine.create(function()
  609. wait()
  610. SlashSound.Parent = nil
  611. end))
  612. end
  613. function fs(parent,p) --Fire Sound
  614. local SlashSound = Instance.new("Sound")
  615. SlashSound.SoundId = "http://www.roblox.com/asset/?id=31758982"
  616. SlashSound.Parent = parent
  617. SlashSound.Volume = .7
  618. SlashSound.Pitch = p
  619. SlashSound.PlayOnRemove = true
  620. coroutine.resume(coroutine.create(function()
  621. wait()
  622. SlashSound.Parent = nil
  623. end))
  624. end
  625. function ms(parent,p) --Metal Cling Sound
  626. local SlashSound = Instance.new("Sound")
  627. SlashSound.SoundId = "rbxasset://sounds\\metal.ogg"
  628. SlashSound.Parent = parent
  629. SlashSound.Volume = 1
  630. SlashSound.Pitch = p
  631. SlashSound.PlayOnRemove = true
  632. coroutine.resume(coroutine.create(function()
  633. wait()
  634. SlashSound.Parent = nil
  635. end))
  636. end
  637. function bs(parent,p) --Berserk Sound
  638. local SlashSound = Instance.new("Sound")
  639. SlashSound.SoundId = "http://www.roblox.com/asset/?id=2676305"
  640. SlashSound.Parent = parent
  641. SlashSound.Volume = 1
  642. SlashSound.Pitch = p
  643. SlashSound.PlayOnRemove = true
  644. coroutine.resume(coroutine.create(function()
  645. wait()
  646. SlashSound.Parent = nil
  647. end))
  648. end
  649. function hs(parent,p) --Arrow Hit Sound
  650. local SlashSound = Instance.new("Sound")
  651. SlashSound.SoundId = "http://www.roblox.com/asset/?id=16211030"
  652. SlashSound.Parent = parent
  653. SlashSound.Volume = 1
  654. SlashSound.Pitch = p
  655. SlashSound.PlayOnRemove = true
  656. coroutine.resume(coroutine.create(function()
  657. wait()
  658. SlashSound.Parent = nil
  659. end))
  660. end
  661. function as(parent,p) --Arrow Shoot Sound
  662. local SlashSound = Instance.new("Sound")
  663. SlashSound.SoundId = "http://www.roblox.com/asset/?id=16211041"
  664. SlashSound.Parent = parent
  665. SlashSound.Volume = 1
  666. SlashSound.Pitch = p
  667. SlashSound.PlayOnRemove = true
  668. coroutine.resume(coroutine.create(function()
  669. wait()
  670. SlashSound.Parent = nil
  671. end))
  672. end
  673. function ars(parent,p) --Arrow Reload Sound
  674. local SlashSound = Instance.new("Sound")
  675. SlashSound.SoundId = "http://www.roblox.com/asset/?id=2697295"
  676. SlashSound.Parent = parent
  677. SlashSound.Volume = 1
  678. SlashSound.Pitch = p
  679. SlashSound.PlayOnRemove = true
  680. coroutine.resume(coroutine.create(function()
  681. wait()
  682. SlashSound.Parent = nil
  683. end))
  684. end
  685. --
  686. --
  687. function returndmg()
  688. mindamage = omindamage
  689. maxdamage = omaxdamage
  690. crtmaxdamage = ocrtmaxdamage
  691. end
  692. function subdmg(sub)
  693. mindamage = omindamage - sub
  694. maxdamage = omaxdamage - sub
  695. crtmaxdamage = ocrtmaxdamage - sub
  696. end
  697. function prcntdmg(sub)
  698. mindamage = math.floor(omindamage - (omindamage*(sub/100)))
  699. maxdamage = math.floor(omaxdamage - (omaxdamage*(sub/100)))
  700. crtmaxdamage = math.floor(ocrtmaxdamage - (ocrtmaxdamage*(sub/100)))
  701. end
  702. function tagHumanoid(humanoid, player)
  703. local creator_tag = Instance.new("ObjectValue")
  704. creator_tag.Value = player
  705. creator_tag.Name = "creator"
  706. creator_tag.Parent = humanoid
  707. end
  708. function untagHumanoid(humanoid)
  709. if humanoid ~= nil then
  710. local tag = humanoid:findFirstChild("creator")
  711. if tag ~= nil then
  712. tag.Parent = nil
  713. end
  714. end
  715. end
  716. local function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  717. return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  718. end
  719. function hideanim()
  720. attack = true
  721. w1.Part0 = prt3
  722. w1.Part1 = RAP
  723. w1.C0 = CFrame.new(0,-1.75, 0.6) * CFrame.Angles(math.rad(-110), math.rad(0), math.rad(0))
  724. for i = 0 , 1 , 0.075 do
  725. wait()
  726. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(10+190*i),math.rad(0),math.rad(20-20*i))
  727. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  728. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(-20))
  729. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  730. w1.C0 = CFrame.new(0,-1.75+1.75*i, 0.6-0.6*i) * CFrame.Angles(math.rad(-110-70*i), math.rad(0), math.rad(0))
  731. end
  732. strmdl = "Bow"
  733. w1.Part0 = prt1
  734. unequipweld()
  735. for i = 0 , 1 , 0.1 do
  736. wait()
  737. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(200-200*i),math.rad(0),math.rad(0))
  738. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  739. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10-10*i),math.rad(0),math.rad(-20+20*i))
  740. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  741. end
  742. RWRem()
  743. LWRem()
  744. attack = false
  745. end
  746. function equipanim()
  747. attack = true
  748. RWFunc()
  749. LWFunc()
  750. for i = 0 , 1 , 0.1 do
  751. wait()
  752. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(200*i),math.rad(0),math.rad(0))
  753. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  754. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-10*i))
  755. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  756. end
  757. w1.Part0 = prt3
  758. w1.Part1 = RAP
  759. w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
  760. w1.C0 = CFrame.Angles(math.rad(-180), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  761. for i = 0 , 1 , 0.05 do
  762. wait()
  763. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(200-190*i),math.rad(0),math.rad(20*i))
  764. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  765. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10*i),math.rad(0),math.rad(-10-10*i))
  766. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  767. w1.C0 = CFrame.new(0,-1.75*i, 0.6*i) * CFrame.Angles(math.rad(-180+70*i), math.rad(0), math.rad(0))
  768. if i > 0.5 then
  769. strmdl = "TopArm"
  770. end
  771. end
  772. equipweld()
  773. returnwelds()
  774. attack = false
  775. end
  776. function faketors()
  777. local T = Instance.new("Part")
  778. T.formFactor = 0
  779. T.CanCollide = false
  780. T.Name = "FakeTorso"
  781. T.Locked = true
  782. T.Size = Torso.Size
  783. T.Parent = swordholder
  784. T.Transparency = 1
  785. T.BrickColor = Torso.BrickColor
  786. for i,z in pairs(Character:GetChildren()) do
  787. if z.className == "CharacterMesh" then
  788. if z.BodyPart == Enum.BodyPart.Torso then
  789. local SM = Instance.new("SpecialMesh",T)
  790. SM.MeshId = "http://www.roblox.com/asset/?id=" .. z.MeshId
  791. if z.BaseTextureId ~= 0 then
  792. SM.TextureId = z.BaseTextureId
  793. elseif z.OverlayTextureId ~= 0 then
  794. SM.TextureId = z.OverlayTextureId
  795. else
  796. SM.TextureId = ""
  797. end
  798. end
  799. end
  800. end
  801. local wt = Instance.new("Weld")
  802. wt.Parent = T
  803. wt.Part0 = T
  804. wt.Part1 = Torso
  805. RW.Part0 = T
  806. LW.Part0 = T
  807. T.Transparency = 0
  808. Torso.Transparency = 1
  809. RHL.Part0 = T
  810. LHL.Part0 = T
  811. return wt,T
  812. end
  813. if (script.Parent.className ~= "HopperBin") then
  814. Tool = Instance.new("HopperBin")
  815. Tool.Parent = Backpack
  816. Tool.Name = ToolName
  817. script.Parent = Tool
  818. end
  819. Bin = script.Parent
  820. function damagesplat(dmg,hit,crit,blocked)
  821. local mo = Instance.new("Model")
  822. mo.Name = dmg
  823. local pa = Instance.new("Part",mo)
  824. pa.formFactor = 3
  825. pa.Size = Vector3.new(0.8,0.3,0.8)
  826. if crit then
  827. pa.BrickColor = BrickColor.new("Bright yellow")
  828. elseif not crit then
  829. pa.BrickColor = BrickColor.new("Bright red")
  830. end
  831. if blocked then pa.BrickColor = BrickColor.new("Bright blue") end
  832. pa.CFrame = CFrame.new(hit.Position) * CFrame.new(0, 3, 0)
  833. pa.Name = "Head"
  834. local hah = Instance.new("Humanoid")
  835. hah.Parent = mo
  836. hah.MaxHealth = 0
  837. hah.Health = 0
  838. local bp = Instance.new("BodyPosition")
  839. bp.P = 14000
  840. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  841. bp.position = hit.Position + Vector3.new(0, 5, 0)
  842. coroutine.resume(coroutine.create(function()
  843. wait()
  844. mo.Parent = workspace
  845. bp.Parent = pa
  846. wait(1.4)
  847. mo:remove()
  848. end))
  849. return pa
  850. end
  851. function damage(hum,dmg,critornot)
  852. local pa = damagesplat(dmg,hum.Torso,critornot)
  853. hum:TakeDamage(dmg)
  854. coroutine.resume(coroutine.create(function()
  855. tagHumanoid(hum,Player)
  856. wait(1)
  857. untagHumanoid(hum)
  858. end))
  859. return pa
  860. end
  861. function AddAmmo(add)
  862. Ammo = Ammo + add
  863. if Ammo > MaxAmmo then
  864. Ammo = MaxAmmo
  865. end
  866. end
  867. function ADmg(humm,hit)
  868. if CurrentArrow == "Normal" then
  869. if humm.Parent:findFirstChild("Block") ~= nil then
  870. if humm.Parent.Block.Value then
  871. damagesplat(0,humm.Torso,false,true)
  872. return
  873. end
  874. end
  875. prcntdmg(50)
  876. if critrandomizer ~= 1 then
  877. local rndmdamage = math.random(mindamage,maxdamage)
  878. damage(humm,rndmdamage,false)
  879. elseif critrandomizer == 1 then
  880. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  881. damage(humm,rndmdamage,true)
  882. end
  883. elseif CurrentArrow == "Poison" then
  884. if humm.Parent:findFirstChild("Block") ~= nil then
  885. if humm.Parent.Block.Value then
  886. damagesplat(0,humm.Torso,false,true)
  887. return
  888. end
  889. end
  890. prcntdmg(75)
  891. if critrandomizer ~= 1 then
  892. local rndmdamage = math.random(mindamage,maxdamage)
  893. damage(humm,rndmdamage,false)
  894. elseif critrandomizer == 1 then
  895. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  896. damage(humm,rndmdamage,true)
  897. end
  898. if math.random(1,5) == 1 then
  899. local poisoncount = math.random(2,10)
  900. coroutine.resume(coroutine.create(function()
  901. repeat
  902. wait(1.5)
  903. poisoncount = poisoncount - 1
  904. local rndmdamage = math.floor(math.random(mindamage,maxdamage)/2)
  905. local pa = damage(humm,rndmdamage,false)
  906. pa.BrickColor = BrickColor.new("Alder")
  907. until poisoncount <= 0
  908. end))
  909. end
  910. elseif CurrentArrow == "Fire" then
  911. if humm.Parent:findFirstChild("Block") ~= nil then
  912. if humm.Parent.Block.Value then
  913. damagesplat(0,humm.Torso,false,true)
  914. return
  915. end
  916. end
  917. prcntdmg(65)
  918. if critrandomizer ~= 1 then
  919. local rndmdamage = math.random(mindamage,maxdamage)
  920. damage(humm,rndmdamage,false)
  921. elseif critrandomizer == 1 then
  922. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  923. damage(humm,rndmdamage,true)
  924. end
  925. local firecount = math.random(5,15)
  926. if humm.Parent:findFirstChild("Fire") ~= nil then
  927. humm.Parent.Fire.Parent = nil
  928. end
  929. coroutine.resume(coroutine.create(function()
  930. local firemod = Instance.new("Model",humm.Parent)
  931. firemod.Name = "Fire"
  932. repeat
  933. wait(0.5+0.5*math.random())
  934. firecount = firecount - 1
  935. local rndmdamage = math.floor(math.random(0,maxdamage/5))
  936. local pa = damage(humm,rndmdamage,false)
  937. for i = 1 , 3 do
  938. wait()
  939. coroutine.resume(coroutine.create(function()
  940. local meshb1 = Instance.new("BlockMesh")
  941. meshb1.Scale = Vector3.new(1,1,1)
  942. local shellb1 = Instance.new("Part")
  943. meshb1.Parent = shellb1
  944. shellb1.Anchored = true
  945. shellb1.formFactor = 3
  946. shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(10,50)/10)
  947. shellb1.CFrame = CFrame.new(humm.Torso.CFrame.p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  948. shellb1.Parent = firemod
  949. shellb1.Transparency = 0
  950. if math.random(1,2) == 1 then
  951. shellb1.BrickColor = BrickColor.new("Bright red")
  952. else
  953. shellb1.BrickColor = BrickColor.new("Bright orange")
  954. end
  955. shellb1.CanCollide = false
  956. local incre = math.random(100,500)/1000
  957. for i = 0 , 1 , 0.1 do
  958. wait()
  959. shellb1.CFrame = shellb1.CFrame + Vector3.new(0,0.15+incre,0)
  960. shellb1.Transparency = 1*i
  961. meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
  962. end
  963. shellb1.Parent=nil
  964. end))
  965. end
  966. until firecount <= 0 or firemod.Parent == nil
  967. firemod.Parent = nil
  968. end))
  969. returndmg()
  970. end
  971. end
  972. function OT(hit) --Normal Damage
  973. if Hitdeb == 1 then return end
  974. if hit.Parent == nil then return end
  975. local hum = hit.Parent:findFirstChild("Humanoid") if hum ~= nil and hum ~= Character.Humanoid then
  976. if hum.Health <= 0 then return end
  977. if hit.Parent:findFirstChild("Block") ~= nil then
  978. if hit.Parent.Block.Value then
  979. damagesplat(0,hum.Torso,false,true)
  980. Hitdeb = 1
  981. if hit.Parent.Block:findFirstChild("BlockPower") ~= nil then
  982. if hit.Parent.Block.BlockPower.Value <= 1 then
  983. hit.Parent.Block.Value = false
  984. elseif hit.Parent.Block.BlockPower.Value > 1 then
  985. local critrandomizer = math.random(crtrate)
  986. if critrandomizer ~= 1 then
  987. hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker
  988. elseif critrandomizer == 1 then
  989. hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker + 2
  990. end
  991. end
  992. end
  993. return end end
  994. local critrandomizer = math.random(crtrate)
  995. if critrandomizer ~= 1 then
  996. local rndmdamage = math.random(mindamage,maxdamage)
  997. damage(hum,rndmdamage,false)
  998. elseif critrandomizer == 1 then
  999. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  1000. damage(hum,rndmdamage,true)
  1001. end
  1002. --
  1003. if CurrentArrow == "Poison" then
  1004. if math.random(1,5) == 1 then
  1005. local poisoncount = math.random(1,5)
  1006. coroutine.resume(coroutine.create(function()
  1007. repeat
  1008. wait(1.5)
  1009. poisoncount = poisoncount - 1
  1010. local rndmdamage = math.floor(math.random(mindamage,maxdamage)/2)
  1011. local pa = damage(hum,rndmdamage,false)
  1012. pa.BrickColor = BrickColor.new("Alder")
  1013. until poisoncount <= 0
  1014. end))
  1015. end
  1016. elseif CurrentArrow == "Fire" then
  1017. local firecount = math.random(3,7)
  1018. if hum.Parent:findFirstChild("Fire") ~= nil then
  1019. hum.Parent.Fire.Parent = nil
  1020. end
  1021. coroutine.resume(coroutine.create(function()
  1022. local firemod = Instance.new("Model",hum.Parent)
  1023. firemod.Name = "Fire"
  1024. repeat
  1025. wait(0.5+0.5*math.random())
  1026. firecount = firecount - 1
  1027. local rndmdamage = math.floor(math.random(0,maxdamage/5))
  1028. local pa = damage(hum,rndmdamage,false)
  1029. for i = 1 , 3 do
  1030. wait()
  1031. coroutine.resume(coroutine.create(function()
  1032. local meshb1 = Instance.new("BlockMesh")
  1033. meshb1.Scale = Vector3.new(1,1,1)
  1034. local shellb1 = Instance.new("Part")
  1035. meshb1.Parent = shellb1
  1036. shellb1.Anchored = true
  1037. shellb1.formFactor = 3
  1038. shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(10,50)/10)
  1039. shellb1.CFrame = CFrame.new(hum.Torso.CFrame.p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  1040. shellb1.Parent = firemod
  1041. shellb1.Transparency = 0
  1042. if math.random(1,2) == 1 then
  1043. shellb1.BrickColor = BrickColor.new("Bright red")
  1044. else
  1045. shellb1.BrickColor = BrickColor.new("Bright orange")
  1046. end
  1047. shellb1.CanCollide = false
  1048. local incre = math.random(100,500)/1000
  1049. for i = 0 , 1 , 0.1 do
  1050. wait()
  1051. shellb1.CFrame = shellb1.CFrame + Vector3.new(0,0.15+incre,0)
  1052. shellb1.Transparency = 1*i
  1053. meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
  1054. end
  1055. shellb1.Parent=nil
  1056. end))
  1057. end
  1058. until firecount <= 0 or firemod.Parent == nil
  1059. firemod.Parent = nil
  1060. end))
  1061. end
  1062. --
  1063. Hitdeb = 1
  1064. end
  1065. end
  1066.  
  1067. function AoE(p,magnitude)
  1068. local c = game.Workspace:GetChildren();
  1069. for i = 1, #c do
  1070. local hum = c[i]:findFirstChild("Humanoid")
  1071. if hum ~= nil and hum.Health ~= 0 then
  1072. local head = c[i]:findFirstChild("Head");
  1073. if head ~= nil then
  1074. local mag = (head.Position - p).magnitude;
  1075. if mag <= magnitude and c[i].Name ~= Character.Name then
  1076. local foundd = false
  1077. for ii = 1 , #AoETrue do
  1078. if AoETrue[ii] == c[i].Name then
  1079. foundd = true
  1080. end
  1081. end
  1082. if foundd then
  1083. end
  1084. --
  1085. if not foundd then
  1086. local critrandomizer = math.random(crtrate)
  1087. if critrandomizer ~= 1 then
  1088. local rndmdamage = math.random(mindamage,maxdamage)
  1089. damage(hum,rndmdamage,false)
  1090. elseif critrandomizer == 1 then
  1091. local rndmdamage = math.random(maxdamage,crtmaxdamage)
  1092. damage(hum,rndmdamage,true)
  1093. end
  1094. table.insert(AoETrue,c[i].Name)
  1095. end
  1096. end
  1097. end
  1098. end
  1099. end
  1100. for ii = 1 , #AoETrue do
  1101. table.remove(AoETrue,#AoETrue)
  1102. end
  1103. end
  1104. --
  1105. --
  1106. function effect(Color,Ref,LP,P1)
  1107. local effectsmsh = Instance.new("BlockMesh")
  1108. effectsmsh.Scale = Vector3.new(1,1,1)
  1109. effectsmsh.Name = "Mesh"
  1110. local effectsg = Instance.new("Part")
  1111. effectsg.formFactor = 3
  1112. effectsg.CanCollide = false
  1113. effectsg.Name = "Eff"
  1114. effectsg.Locked = true
  1115. effectsg.Anchored = true
  1116. effectsg.Size = Vector3.new(0.2,1,0.2)
  1117. effectsg.Parent = swordholder
  1118. effectsmsh.Parent = effectsg
  1119. effectsg.BrickColor = BrickColor.new(Color)
  1120. effectsg.Reflectance = Ref
  1121. local point1 = P1
  1122. local mg = (LP.p - point1.p).magnitude
  1123. effectsg.Size = Vector3.new(0.2,mg,0.2)
  1124. effectsg.CFrame = CFrame.new((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  1125. coroutine.resume(coroutine.create(function()
  1126. for i = 0 , 1 , 0.1 do
  1127. wait()
  1128. effectsg.Transparency = 1*i
  1129. effectsmsh.Scale = Vector3.new(1-1*i,1,1-1*i)
  1130. end
  1131. wait()
  1132. effectsg.Parent = nil
  1133. end))
  1134. end
  1135. --
  1136. con = nil
  1137. function dmgcnnct()
  1138. if con ~= nil then
  1139. con:disconnect()
  1140. Hitdeb = 0
  1141. end
  1142. con = prt11.Touched:connect(OT)
  1143. end
  1144. function dmgdc()
  1145. if con ~= nil then
  1146. con:disconnect()
  1147. Hitdeb = 0
  1148. end
  1149. end
  1150. function rptddmg(value,des,inc)
  1151. coroutine.resume(coroutine.create(function()
  1152. repeat
  1153. wait(inc)
  1154. Hitdeb = 0
  1155. until value == des
  1156. end))
  1157. end
  1158. function atktype(s,e)
  1159. coroutine.resume(coroutine.create(function ()
  1160. attacktype = e
  1161. wait(0.25)
  1162. attacktype = s
  1163. end))
  1164. end
  1165. function shoottrail(mouse) -- here
  1166. local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread)) / 100) * (prt1.Position-mouse.Hit.p).magnitude/100
  1167. local dir = CFrame.new((prt1.Position+mouse.Hit.p)/2,mouse.Hit.p+spreadvector) -- to here
  1168. local hit,pos = rayCast(prt1.Position,dir.lookVector,10,Character) -- here
  1169. local rangepos = range
  1170. local function drawtrail(From,To)
  1171. local effectsmsh = Instance.new("CylinderMesh")
  1172. effectsmsh.Scale = Vector3.new(1,1,1)
  1173. effectsmsh.Name = "Mesh"
  1174. local effectsg = Instance.new("Part")
  1175. effectsg.formFactor = 3
  1176. effectsg.CanCollide = false
  1177. effectsg.Name = "Eff"
  1178. effectsg.Locked = true
  1179. effectsg.Anchored = true
  1180. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  1181. effectsg.Parent = swordholder
  1182. effectsmsh.Parent = effectsg
  1183. effectsg.BrickColor = arrowtrail
  1184. effectsg.Reflectance = 0.25
  1185. local LP = From
  1186. local point1 = To
  1187. local mg = (LP - point1).magnitude
  1188. effectsmsh.Scale = Vector3.new(1,mg*5,1)
  1189. effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
  1190. coroutine.resume(coroutine.create(function()
  1191. for i = 0 , 1 , 0.1 do
  1192. wait()
  1193. effectsg.Transparency = 1*i
  1194. effectsmsh.Scale = Vector3.new(1-1*i,mg*5,1-1*i)
  1195. end
  1196. effectsg.Parent = nil
  1197. end))
  1198. end
  1199. local newpos = prt1.Position
  1200. local inc = rangepower
  1201. repeat
  1202. wait() wait()
  1203. rangepos = rangepos - 10
  1204. dir = dir * CFrame.Angles(math.rad(-1),0,0)
  1205. hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
  1206. drawtrail(newpos,pos)
  1207. newpos = newpos + (dir.lookVector * inc)
  1208. if inc >= 20 then
  1209. inc = inc - 10
  1210. end
  1211. if hit ~= nil then
  1212. rangepos = 0
  1213. end
  1214. until rangepos <= 0
  1215. if hit ~= nil then
  1216. hs(Head,1)
  1217. local effectsmsh = Instance.new("SpecialMesh")
  1218. effectsmsh.MeshId = "http://www.roblox.com/asset/?id=15887356"
  1219. effectsmsh.TextureId = "http://www.roblox.com/asset/?id=15886781"
  1220. effectsmsh.Scale = Vector3.new(1,1,2.5)
  1221. local effectsg = Instance.new("Part")
  1222. effectsg.formFactor = 3
  1223. effectsg.CanCollide = false
  1224. effectsg.Name = "Arrow"
  1225. effectsg.Locked = true
  1226. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  1227. effectsg.Parent = swordholder
  1228. effectsmsh.Parent = effectsg
  1229. effectsg.CFrame = CFrame.new(newpos,pos) + CFrame.new(newpos,pos).lookVector*2.5*2
  1230. local weld = Instance.new("Weld")
  1231. weld.Part0 = effectsg
  1232. weld.Part1 = hit
  1233. local HitPos = effectsg.Position + CFrame.new(newpos,pos).lookVector*0.75
  1234. local CJ = CFrame.new(HitPos)
  1235. local C0 = effectsg.CFrame:inverse() * CJ
  1236. local C1 = hit.CFrame:inverse() * CJ
  1237. weld.C0 = C0
  1238. weld.C1 = C1
  1239. weld.Parent = effectsg
  1240. coroutine.resume(coroutine.create(function()
  1241. wait(15)
  1242. effectsg.Parent = nil
  1243. end))
  1244. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  1245. hum = hit.Parent.Humanoid
  1246. ADmg(hum,hit)
  1247. elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
  1248. hum = hit.Parent.Parent.Humanoid
  1249. ADmg(hum,hit)
  1250. end
  1251. end
  1252. end
  1253. function Ready(z)
  1254. if Ammo <= 0 then Reload() return end
  1255. attack = true
  1256. local wt,t = faketors()
  1257. w9.Part1 = t
  1258. w8.Part1 = t
  1259. Character.Humanoid.WalkSpeed = 5
  1260. for i = 0 , 1 , 0.2 do
  1261. wait()
  1262. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(20+60*i))
  1263. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1264. LW.C0 = CFrame.new(-1.5+1.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(-20+110*i))
  1265. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1266. w1.C0 = CFrame.Angles(math.rad(-90), 0, math.rad(0)) * CFrame.new(0.25*i, 0, 0)
  1267. wt.C0 = CFrame.Angles(0, math.rad(-80*i), 0)
  1268. w11.C0 = CFrame.Angles(math.rad(-90*i),0,math.rad(90-95*i)) * CFrame.new(0,1+1.5*i,0)
  1269. end
  1270. strmdl = "LeftArm"
  1271. for i = 0 , 1 , 0.25 do
  1272. wait()
  1273. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(80))
  1274. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1275. LW.C0 = CFrame.new(-1.5*i, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(90))
  1276. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1277. w1.C0 = CFrame.Angles(math.rad(-90), 0, math.rad(0)) * CFrame.new(0.25, 0, 0)
  1278. wt.C0 = CFrame.Angles(0, math.rad(-80), 0)
  1279. end
  1280. repeat
  1281. wait()
  1282. until not keyhold
  1283. strmdl = "Bow"
  1284. as(Head,1)
  1285. --ss(Head,2)
  1286. for i = 1 , Ammo do
  1287. coroutine.resume(coroutine.create(function()
  1288. shoottrail(z)
  1289. end))
  1290. end
  1291. Ammo = 0
  1292. for i = 0 , 1 , 0.2 do
  1293. wait()
  1294. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90+10*i),math.rad(0),math.rad(80))
  1295. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1296. LW.C0 = CFrame.new(-1.5, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(90-45*i))
  1297. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-45*i), 0, 0)
  1298. w1.C0 = CFrame.Angles(math.rad(-90), 0, math.rad(0)) * CFrame.new(0.25, 0, 0)
  1299. wt.C0 = CFrame.Angles(0, math.rad(-80+40*i), 0)
  1300. end
  1301. for i = 0 , 1 , 0.2 do
  1302. wait()
  1303. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(100+10*i),math.rad(0),math.rad(80))
  1304. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1305. LW.C0 = CFrame.new(-1.5, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(45))
  1306. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-45-10*i), 0, 0)
  1307. w1.C0 = CFrame.Angles(math.rad(-90), 0, math.rad(0)) * CFrame.new(0.25, 0, 0)
  1308. wt.C0 = CFrame.Angles(0, math.rad(-40+40*i), 0)
  1309. end
  1310. strmdl = "TopArm"
  1311. w11.C0 = CFrame.Angles(0,0,math.rad(90)) * CFrame.new(0,1,0)
  1312. w9.Part1 = Torso
  1313. w8.Part1 = Torso
  1314. RW.Part0 = Torso
  1315. LW.Part0 = Torso
  1316. Torso.Transparency = 0
  1317. RHL.Part0 = Torso
  1318. LHL.Part0 = Torso
  1319. t.Parent = nil
  1320. Character.Humanoid.WalkSpeed = 14
  1321. for i = 0 , 1 , 0.2 do
  1322. wait()
  1323. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(110-100*i),math.rad(0),math.rad(80-60*i))
  1324. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1325. LW.C0 = CFrame.new(-1.5, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(45-65*i))
  1326. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-55+45*i), 0, 0)
  1327. w1.C0 = CFrame.Angles(math.rad(-90), 0, math.rad(0)) * CFrame.new(0.25-0.25*i, 0, 0)
  1328. end
  1329. attack = false
  1330. end
  1331. function Reload()
  1332. attack = true
  1333. for i = 0 , 1 , 0.2 do
  1334. wait()
  1335. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(10-20*i),math.rad(0),math.rad(20))
  1336. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1337. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10-55*i),math.rad(0),math.rad(-20-10*i))
  1338. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1339. w11.C0 = CFrame.Angles(math.rad(90*i),0,math.rad(90-15*i)) * CFrame.new(0,1,0)
  1340. end
  1341. AddAmmo(Ammoregen)
  1342. for i = 0 , 1 , 0.2 do
  1343. wait()
  1344. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-10),math.rad(0),math.rad(20))
  1345. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1346. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(-45),math.rad(0),math.rad(-30-10*i))
  1347. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
  1348. w11.C0 = CFrame.Angles(math.rad(90-90*i),math.rad(-90*i),math.rad(75)) * CFrame.new(0,1,0)
  1349. end
  1350. for i = 0 , 1 , 0.2 do
  1351. wait()
  1352. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-10+20*i),math.rad(0),math.rad(20))
  1353. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1354. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(-45+55*i),math.rad(0),math.rad(-40+20*i))
  1355. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
  1356. w11.C0 = CFrame.Angles(math.rad(0),math.rad(-90+90*i),math.rad(75+15*i)) * CFrame.new(0,1,0)
  1357. end
  1358. attack = false
  1359. end
  1360. function NormalArrows()
  1361. attack = true
  1362. strmdl = "Bow"
  1363. for i = 0 , 1 , 0.1 do
  1364. wait()
  1365. RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(20-65*i))
  1366. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1367. LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(-20+65*i))
  1368. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25*i), 0, 0)
  1369. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45*i)) * CFrame.new(0, 0, 0)
  1370. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10*i),0,0)
  1371. end
  1372. ars(Head,0.5)
  1373. for i = 0 , 1 , 0.2 do
  1374. wait()
  1375. RW.C0 = CFrame.new(1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45))
  1376. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5*i), 0, 0)
  1377. LW.C0 = CFrame.new(-1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(45))
  1378. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25+30*i), 0, 0)
  1379. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45)) * CFrame.new(0, 0, 0)
  1380. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+15*i),0,0)
  1381. end
  1382. for i = 0 , 1 , 0.1 do
  1383. wait()
  1384. RW.C0 = CFrame.new(1+0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(-45+65*i))
  1385. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1386. LW.C0 = CFrame.new(-1-0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(45-65*i))
  1387. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1388. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45+45*i)) * CFrame.new(0, 0, 0)
  1389. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-5*i),0,0)
  1390. end
  1391. CurrentArrow = "Normal"
  1392. arrowtrail = BrickColor.new("White")
  1393. strmdl = "TopArm"
  1394. attack = false
  1395. end
  1396. function PoisonArrows()
  1397. attack = true
  1398. strmdl = "Bow"
  1399. for i = 0 , 1 , 0.1 do
  1400. wait()
  1401. RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(20-65*i))
  1402. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1403. LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(-20+65*i))
  1404. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25*i), 0, 0)
  1405. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45*i)) * CFrame.new(0, 0, 0)
  1406. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10*i),0,0)
  1407. end
  1408. ars(Head,0.5)
  1409. for i = 0 , 1 , 0.2 do
  1410. wait()
  1411. RW.C0 = CFrame.new(1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45))
  1412. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5*i), 0, 0)
  1413. LW.C0 = CFrame.new(-1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(45))
  1414. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25+30*i), 0, 0)
  1415. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45)) * CFrame.new(0, 0, 0)
  1416. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+15*i),0,0)
  1417. end
  1418. for i = 0 , 1 , 0.1 do
  1419. wait()
  1420. RW.C0 = CFrame.new(1+0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(-45+65*i))
  1421. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1422. LW.C0 = CFrame.new(-1-0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(45-65*i))
  1423. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1424. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45+45*i)) * CFrame.new(0, 0, 0)
  1425. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-5*i),0,0)
  1426. end
  1427. CurrentArrow = "Poison"
  1428. arrowtrail = BrickColor.new("Bright violet")
  1429. strmdl = "TopArm"
  1430. attack = false
  1431. coroutine.resume(coroutine.create(function()
  1432. repeat
  1433. wait(0.25+0.75*math.random())
  1434. if Ammo ~= 0 then
  1435. local meshb1 = Instance.new("SpecialMesh")
  1436. meshb1.Scale = Vector3.new(1,1,1)
  1437. meshb1.MeshType = "Sphere"
  1438. local shellb1 = Instance.new("Part")
  1439. meshb1.Parent = shellb1
  1440. shellb1.Anchored = true
  1441. shellb1.formFactor = 3
  1442. shellb1.Size = Vector3.new(0.3,0.3,0.3)
  1443. shellb1.CFrame = CFrame.new((prt11.CFrame * CFrame.new(0,0,2)).p)
  1444. shellb1.Parent = swordholder
  1445. shellb1.Transparency = 0
  1446. shellb1.BrickColor = BrickColor.new("Alder")
  1447. shellb1.CanCollide = false
  1448. for i = 0 , 1 , 0.1 do
  1449. wait()
  1450. shellb1.CFrame = shellb1.CFrame + Vector3.new(0,-0.15,0)
  1451. shellb1.Transparency = 1*i
  1452. meshb1.Scale = Vector3.new(1,1+3*i,1)
  1453. end
  1454. shellb1.Parent=nil
  1455. end
  1456. until CurrentArrow ~= "Poison"
  1457. end))
  1458. end
  1459. function FireArrows()
  1460. attack = true
  1461. strmdl = "Bow"
  1462. for i = 0 , 1 , 0.1 do
  1463. wait()
  1464. RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(20-65*i))
  1465. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1466. LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(-20+65*i))
  1467. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25*i), 0, 0)
  1468. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45*i)) * CFrame.new(0, 0, 0)
  1469. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10*i),0,0)
  1470. end
  1471. ars(Head,0.5)
  1472. for i = 0 , 1 , 0.2 do
  1473. wait()
  1474. RW.C0 = CFrame.new(1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45))
  1475. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5*i), 0, 0)
  1476. LW.C0 = CFrame.new(-1, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(45))
  1477. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-25+30*i), 0, 0)
  1478. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45)) * CFrame.new(0, 0, 0)
  1479. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+15*i),0,0)
  1480. end
  1481. for i = 0 , 1 , 0.1 do
  1482. wait()
  1483. RW.C0 = CFrame.new(1+0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(-45+65*i))
  1484. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1485. LW.C0 = CFrame.new(-1-0.5*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(45-65*i))
  1486. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(5-5*i), 0, 0)
  1487. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(-45+45*i)) * CFrame.new(0, 0, 0)
  1488. Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-5*i),0,0)
  1489. end
  1490. CurrentArrow = "Fire"
  1491. arrowtrail = BrickColor.new("Bright red")
  1492. strmdl = "TopArm"
  1493. attack = false
  1494. coroutine.resume(coroutine.create(function()
  1495. repeat
  1496. wait(0.1+0.15*math.random())
  1497. if Ammo ~= 0 then
  1498. coroutine.resume(coroutine.create(function()
  1499. local meshb1 = Instance.new("BlockMesh")
  1500. meshb1.Scale = Vector3.new(1,1,1)
  1501. local shellb1 = Instance.new("Part")
  1502. meshb1.Parent = shellb1
  1503. shellb1.Anchored = true
  1504. shellb1.formFactor = 3
  1505. shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(10,50)/10)
  1506. shellb1.CFrame = CFrame.new((prt11.CFrame * CFrame.new(0,0,2)).p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
  1507. shellb1.Parent = swordholder
  1508. shellb1.Transparency = 0
  1509. if math.random(1,2) == 1 then
  1510. shellb1.BrickColor = BrickColor.new("Bright red")
  1511. else
  1512. shellb1.BrickColor = BrickColor.new("Bright orange")
  1513. end
  1514. shellb1.CanCollide = false
  1515. local incre = math.random(100,500)/1000
  1516. for i = 0 , 1 , 0.1 do
  1517. wait()
  1518. shellb1.CFrame = shellb1.CFrame + Vector3.new(0,0.15+incre,0)
  1519. shellb1.Transparency = 1*i
  1520. meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
  1521. end
  1522. shellb1.Parent=nil
  1523. end))
  1524. end
  1525. until CurrentArrow ~= "Fire"
  1526. end))
  1527. end
  1528. function MeleeArrow()
  1529. if Ammo == 0 then return end
  1530. attack = true
  1531. ss(Head,1)
  1532. for i = 0 , 1 , 0.2 do
  1533. wait()
  1534. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(10+35*i),math.rad(0),math.rad(20+50*i))
  1535. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1536. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10+80*i),math.rad(0),math.rad(-20-90*i))
  1537. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(90*i), 0)
  1538. w11.C0 = CFrame.Angles(math.rad(0),0,math.rad(90)) * CFrame.new(0,1,-1*i)
  1539. w11.C1 = CFrame.Angles(math.rad(0),0,math.rad(0))
  1540. end
  1541. prcntdmg(25)
  1542. dmgcnnct()
  1543. local lp = prt11.CFrame * CFrame.new(0,0,2)
  1544. for i = 0 , 1 , 0.25 do
  1545. wait()
  1546. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(45),math.rad(0),math.rad(70+40*i))
  1547. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1548. LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -1*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-110+155*i))
  1549. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(90), 0)
  1550. w11.C0 = CFrame.Angles(math.rad(0),0,math.rad(90)) * CFrame.new(0,1,-1)
  1551. w11.C1 = CFrame.Angles(math.rad(0),0,math.rad(0))
  1552. local Point = prt11.CFrame * CFrame.new(0,0,2)
  1553. effect("White",0.5,lp,Point)
  1554. lp = Point
  1555. end
  1556. for i = 0 , 1 , 0.2 do
  1557. wait()
  1558. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(45),math.rad(0),math.rad(110+30*i))
  1559. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1560. LW.C0 = CFrame.new(-1+0.5*i, 0.5, -1) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(45+45*i))
  1561. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(90), 0)
  1562. w11.C0 = CFrame.Angles(math.rad(0),0,math.rad(90)) * CFrame.new(0,1,-1+1*i)
  1563. w11.C1 = CFrame.Angles(math.rad(90*i),0,math.rad(0)) * CFrame.new(0,1*i,2*i)
  1564. local Point = prt11.CFrame * CFrame.new(0,0,2)
  1565. effect("White",0.5,lp,Point)
  1566. lp = Point
  1567. end
  1568. for i = 0 , 1 , 0.1 do
  1569. wait()
  1570. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(45-35*i),math.rad(0),math.rad(140-120*i))
  1571. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1572. LW.C0 = CFrame.new(-0.5-1*i, 0.5, -1+1*i) * CFrame.Angles(math.rad(90-80*i),math.rad(0),math.rad(90-110*i))
  1573. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(90-90*i), 0)
  1574. w11.C0 = CFrame.Angles(math.rad(0),0,math.rad(90)) * CFrame.new(0,1,0)
  1575. w11.C1 = CFrame.Angles(math.rad(90-90*i),0,math.rad(0)) * CFrame.new(0,1-1*i,2-2*i)
  1576. end
  1577. dmgdc()
  1578. returndmg()
  1579. attack = false
  1580. end
  1581. function returnwelds()
  1582. RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(20))
  1583. RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1584. LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(-20))
  1585. LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
  1586. w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
  1587. RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
  1588. RWL.C1 = CFrame.new(0.5, 1, 0)
  1589. LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
  1590. LWL.C1 = CFrame.new(-0.5, 1, 0)
  1591. Neck.C0 = neckcf0
  1592. end
  1593. if key == "z" then
  1594. MeleeArrow()
  1595. end
  1596. keyhold = false
  1597. function ob1d(mouse)
  1598. hold = true
  1599. if attack then return end
  1600. keyhold = true
  1601. Ready(mouse)
  1602. end
  1603. function ob1u(mouse)
  1604. keyhold = false
  1605. end
  1606. buttonhold = false
  1607. function key(key,z)
  1608. if attack then return end
  1609. if key == "x" then -- f original key
  1610. Reload()
  1611. end
  1612. if key == "q" then
  1613. MeleeArrow()
  1614. end
  1615. if key == "e" then
  1616. NormalArrows()
  1617. end
  1618. if key == "r" then
  1619. PoisonArrows()
  1620. end
  1621. if key == "t" then
  1622. FireArrows()
  1623. end
  1624. end
  1625. function key2(key)
  1626. if key == "x" then
  1627. buttonhold = false
  1628. end
  1629. end
  1630. function s(mouse)
  1631. repeat wait() until not attack
  1632. repeat wait() until not ev.Value -- here
  1633. mouse.Button1Down:connect(function() ob1d(mouse) end)
  1634. mouse.Button1Up:connect(function() ob1u(mouse) end)
  1635. mouse.KeyDown:connect(function(ke) key(ke,mouse) end)
  1636. mouse.KeyUp:connect(key2)
  1637. equipanim()
  1638. ev.Value = true
  1639. end
  1640. function ds(z)
  1641. keyhold = false
  1642. repeat wait() until not attack
  1643. repeat wait() until ev.Value
  1644. hideanim()
  1645. wait(0.1)
  1646. ev.Value = false
  1647. end
  1648. Bin.Selected:connect(s)
  1649. Bin.Deselected:connect(ds)
  1650. if PlayerGui:findFirstChild("AmmoMeter") ~= nil then
  1651. PlayerGui:findFirstChild("AmmoMeter").Parent = nil
  1652. end
  1653. coroutine.resume(coroutine.create(function()
  1654. local SG = Instance.new("ScreenGui",PlayerGui)
  1655. SG.Name = "AmmoMeter"
  1656. local frame = Instance.new("Frame",SG)
  1657. frame.Size = UDim2.new(0.2,0,0.1,0)
  1658. frame.Position = UDim2.new(0.5-0.1,0,0.05,0)
  1659. frame.BackgroundColor3 = BrickColor.new("Brown").Color
  1660. local Ammotext = Instance.new("TextLabel",frame)
  1661. Ammotext.Size = UDim2.new(1,0,0.35,0)
  1662. Ammotext.BackgroundTransparency = 1
  1663. Ammotext.Text = "Ammo"
  1664. Ammotext.FontSize = "Size18"
  1665. Ammotext.TextColor3 = BrickColor.new("White").Color
  1666. local backing = Instance.new("ImageLabel",frame)
  1667. backing.Size = UDim2.new(0.8,0,0.45,0)
  1668. backing.Image = "http://www.roblox.com/asset/?id=48965808"
  1669. backing.Position = UDim2.new(0.1,0,0.45,0)
  1670. backing.BackgroundColor3 = BrickColor.new("Black").Color
  1671. local img = Instance.new("ImageLabel",backing)
  1672. img.Size = UDim2.new(1,0,1,0)
  1673. img.Image = "http://www.roblox.com/asset/?id=48965808"
  1674. img.Position = UDim2.new(0,0,0,0)
  1675. img.BackgroundColor3 = BrickColor.new("Brown").Color
  1676. local percent = Instance.new("TextLabel",backing)
  1677. percent.Size = UDim2.new(1,0,1,0)
  1678. percent.BackgroundTransparency = 1
  1679. percent.TextColor3 = BrickColor.new("White").Color
  1680. percent.Text = Ammo.."/".. MaxAmmo
  1681. percent.FontSize = "Size18"
  1682. local currentam = Instance.new("TextLabel",frame)
  1683. currentam.Size = UDim2.new(0.5,0,0.25,0)
  1684. currentam.Position = UDim2.new(0,0,1,0)
  1685. currentam.BackgroundTransparency = 0
  1686. currentam.BackgroundColor3 = BrickColor.new("Brown").Color
  1687. currentam.TextColor3 = BrickColor.new("White").Color
  1688. currentam.Text = CurrentArrow
  1689. currentam.FontSize = "Size18"
  1690. repeat
  1691. wait()
  1692. pcall(function()
  1693. img.Size = UDim2.new(1*(Ammo/MaxAmmo),0,1,0)
  1694. percent.Text = Ammo.."/".. MaxAmmo
  1695. currentam.Text = CurrentArrow
  1696. end)
  1697. until SG.Parent == nil
  1698. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement