Advertisement
Animescapetower

Handle

Mar 14th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.25 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. Sparkles2 = Instance.new("Sparkles")
  22. BoolValue3 = Instance.new("BoolValue")
  23. PointLight4 = Instance.new("PointLight")
  24. Animation5 = Instance.new("Animation")
  25. Animation6 = Instance.new("Animation")
  26. BoolValue7 = Instance.new("BoolValue")
  27. BoolValue8 = Instance.new("BoolValue")
  28. StringValue9 = Instance.new("StringValue")
  29. LocalScript10 = Instance.new("LocalScript")
  30. Animation11 = Instance.new("Animation")
  31. Animation12 = Instance.new("Animation")
  32. Animation13 = Instance.new("Animation")
  33. IntValue14 = Instance.new("IntValue")
  34. Script15 = Instance.new("Script")
  35. ScreenGui16 = Instance.new("ScreenGui")
  36. Frame17 = Instance.new("Frame")
  37. Frame18 = Instance.new("Frame")
  38. Frame19 = Instance.new("Frame")
  39. TextLabel20 = Instance.new("TextLabel")
  40. Script21 = Instance.new("Script")
  41. Script22 = Instance.new("Script")
  42. Script23 = Instance.new("Script")
  43. Tool0.Name = "RSaber"
  44. Tool0.Parent = mas
  45. Tool0.TextureId = "http://www.roblox.com/asset/?id=202581977"
  46. Tool0.GripForward = Vector3.new(4.37113883e-08, -0, -1)
  47. Tool0.GripPos = Vector3.new(-4.80825264e-08, -0.900000036, -2.10175408e-15)
  48. Tool0.GripRight = Vector3.new(1, -4.37113883e-08, 4.37113883e-08)
  49. Tool0.GripUp = Vector3.new(4.37113883e-08, 1, 1.91068547e-15)
  50. Part1.Name = "Handle"
  51. Part1.Parent = Tool0
  52. Part1.Transparency = 1
  53. Part1.Rotation = Vector3.new(-90, 0, -180)
  54. Part1.CanCollide = false
  55. Part1.FormFactor = Enum.FormFactor.Custom
  56. Part1.Size = Vector3.new(0.200000003, 6, 0.899999976)
  57. Part1.CFrame = CFrame.new(47.3373795, 1.99821472, -8.96564388, -1, 4.37113883e-08, -4.37113883e-08, -4.37113883e-08, 6.12323426e-17, 1, 4.37113883e-08, 1, 1.84945303e-15)
  58. Part1.BottomSurface = Enum.SurfaceType.Smooth
  59. Part1.TopSurface = Enum.SurfaceType.Smooth
  60. Part1.Position = Vector3.new(47.3373795, 1.99821472, -8.96564388)
  61. Part1.Orientation = Vector3.new(-90, -180, 0)
  62. Sparkles2.Parent = Part1
  63. Sparkles2.Color = Color3.new(1.77083, 10.2, 0)
  64. Sparkles2.Enabled = false
  65. Sparkles2.SparkleColor = Color3.new(1, 1, 0)
  66. Sparkles2.Color = Color3.new(1.77083, 10.2, 0)
  67. BoolValue3.Name = "Blockable"
  68. BoolValue3.Parent = Part1
  69. BoolValue3.Value = true
  70. PointLight4.Parent = Part1
  71. PointLight4.Color = Color3.new(1, 0, 0)
  72. PointLight4.Range = 12
  73. PointLight4.Color = Color3.new(1, 0, 0)
  74. Animation5.Name = "LeftSlash"
  75. Animation5.Parent = Tool0
  76. Animation5.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
  77. Animation6.Name = "Equip"
  78. Animation6.Parent = Tool0
  79. Animation6.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  80. BoolValue7.Name = "MouseDown"
  81. BoolValue7.Parent = Tool0
  82. BoolValue8.Name = "Reloading"
  83. BoolValue8.Parent = Tool0
  84. StringValue9.Name = "RunAnim"
  85. StringValue9.Parent = Tool0
  86. LocalScript10.Parent = Tool0
  87. table.insert(cors,sandbox(LocalScript10,function()
  88. --Made by Stickmasterluke
  89.  
  90.  
  91. sp=script.Parent
  92.  
  93.  
  94. function waitfor(a,b)
  95. while a:FindFirstChild(b)==nil do
  96. a.ChildAdded:wait()
  97. end
  98. return a:FindFirstChild(b)
  99. end
  100.  
  101. reloading=waitfor(sp,"Reloading")
  102. down=waitfor(sp,"MouseDown")
  103. runanim=waitfor(sp,"RunAnim")
  104.  
  105. animspeed=2.4 --lower number is slower
  106. equipspeed=1.5
  107. originalgrip=CFrame.new(0,0,-1.1,0,0,1,1,0,0,0,1,0)
  108. currentgrip=originalgrip
  109. function swordUp()
  110. currentgrip=originalgrip
  111. sp.Grip=currentgrip
  112. end
  113. function swordOut()
  114. currentgrip=originalgrip*CFrame.Angles(math.pi/4,.4,0)
  115. sp.Grip=currentgrip
  116. end
  117. function spinsword(spintime)
  118. delay(0,function()
  119. local startspin=tick()
  120. local endspin=startspin+spintime
  121. while tick()<endspin do
  122. sp.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
  123. wait()
  124. end
  125. sp.Grip=currentgrip
  126. end)
  127. end
  128.  
  129. function update(mouse)
  130. if mouse~=nil then
  131. if reloading.Value then
  132. mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
  133. else
  134. mouse.Icon="rbxasset://textures\\GunCursor.png"
  135. end
  136. end
  137. end
  138.  
  139. runanim.Changed:connect(function()
  140. local h=sp.Parent:FindFirstChild("Humanoid")
  141. local t=sp.Parent:FindFirstChild("Torso")
  142. local anim=sp:FindFirstChild(runanim.Value)
  143. if anim and t and h then
  144. local theanim=h:LoadAnimation(anim)
  145. if theanim and h.Health>0 then
  146. theanim:Play(nil,nil,animspeed)
  147. end
  148. end
  149. end)
  150.  
  151.  
  152. function Equipped(mouse)
  153. if mouse~=nil then
  154. update(mouse)
  155. reloading.Changed:connect(function()
  156. update(mouse)
  157. end)
  158. mouse.Button1Down:connect(function()
  159. down.Value=true
  160. end)
  161. mouse.Button1Up:connect(function()
  162. down.Value=false
  163. end)
  164. local h=sp.Parent:FindFirstChild("Humanoid")
  165. local t=sp.Parent:FindFirstChild("Torso")
  166. if t and h then
  167. local equipanim=sp:FindFirstChild("Equip")
  168. if equipanim~=nil then
  169. local EquipAnim=h:LoadAnimation(equipanim)
  170. if EquipAnim and h.Health>0 then
  171. EquipAnim:Play(nil,nil,equipspeed)
  172. end
  173. end
  174. local holdanim=sp:FindFirstChild("Hold")
  175. if holdanim~=nil then
  176. if HoldAnim then
  177. HoldAnim:Stop()
  178. end
  179. HoldAnim=h:LoadAnimation(holdanim)
  180. if HoldAnim and h.Health>0 then
  181. HoldAnim:Play()
  182. end
  183. end
  184. end
  185. end
  186. end
  187.  
  188. function Unequipped()
  189. down.Value=false
  190. if HoldAnim then
  191. HoldAnim:Stop()
  192. end
  193. end
  194.  
  195. sp.Equipped:connect(Equipped)
  196. sp.Unequipped:connect(Unequipped)
  197.  
  198. end))
  199. Animation11.Name = "Hold"
  200. Animation11.Parent = Tool0
  201. Animation11.AnimationId = "http://www.roblox.com/Asset?ID=96559165"
  202. Animation12.Name = "Stab1"
  203. Animation12.Parent = Tool0
  204. Animation12.AnimationId = "http://www.roblox.com/Asset?ID=96559159"
  205. Animation13.Name = "Stab2"
  206. Animation13.Parent = Tool0
  207. Animation13.AnimationId = "http://www.roblox.com/Asset?ID=96559161"
  208. IntValue14.Name = "WeaponSpeed"
  209. IntValue14.Parent = Tool0
  210. IntValue14.Value = 98
  211. Script15.Parent = Tool0
  212. table.insert(cors,sandbox(Script15,function()
  213. --Made by Stickmasterluke
  214.  
  215.  
  216. sp=script.Parent
  217.  
  218.  
  219. damage=50 -- +/- 10%
  220. damagewindow=1 --after clicking, how long does the player have to hit the opponent wioth their weapon to deal damage
  221. swingrate=.2
  222.  
  223. clashsounds={163064102,185722889}
  224. swooshsounds={165344304,145486992}
  225. hitsounds={138079201,142491739}
  226. anims={"Stab1","Stab2","LeftSlash"}
  227.  
  228.  
  229.  
  230. ready=false
  231. equipped=false
  232. rate=1/30
  233. lastswing=0
  234.  
  235.  
  236. function waitfor(a,b)
  237. while a:FindFirstChild(b)==nil do
  238. a.ChildAdded:wait()
  239. end
  240. return a:FindFirstChild(b)
  241. end
  242.  
  243. reloading=waitfor(sp,"Reloading")
  244. down=waitfor(sp,"MouseDown")
  245. runanim=waitfor(sp,"RunAnim")
  246. sparkles=waitfor(sp.Handle,"Sparkles")
  247. debris=game:getService("Debris")
  248. weaponhud=waitfor(sp,"WeaponHud")
  249. weaponnametag=waitfor(weaponhud,"WeaponName")
  250. guibar=waitfor(weaponhud,"Bar")
  251. guibarfill=waitfor(guibar,"Fill")
  252. weaponnametag.Text=sp.Name
  253.  
  254. function runsound(id,volume)
  255. local volume=volume or 1
  256. local sound=Instance.new("Sound")
  257. sound.Looped=false
  258. sound.Pitch=1.5
  259. sound.SoundId="http://www.roblox.com/asset/?id="..tostring(id)
  260. sound.PlayOnRemove=false
  261. sound.Volume=volume
  262. debris:AddItem(sound,3)
  263. sound.Parent=sp.Handle
  264. wait()
  265. sound:Play()
  266. end
  267.  
  268. function billboard(pos,text,time,color)
  269. local pos=pos or Vector3.new(0,0,0)
  270. local text=text or "Hello World!"
  271. local time=time or 2
  272. local color=color or Color3.new(1,0,0)
  273. local pos=pos+Vector3.new(0,5,0)
  274. local ep=Instance.new("Part")
  275. ep.Name="Effect"
  276. ep.formFactor="Custom"
  277. ep.Size=Vector3.new(0,0,0)
  278. ep.TopSurface="Smooth"
  279. ep.BottomSurface="Smooth"
  280. ep.CFrame=CFrame.new(pos)
  281. ep.Anchored=true
  282. ep.CanCollide=false
  283. ep.Transparency=1
  284. local bb=Instance.new("BillboardGui")
  285. bb.Size=UDim2.new(3,0,3,0)
  286. bb.Adornee=ep
  287. bb.Enabled = false
  288. local tl=Instance.new("TextLabel")
  289. tl.BackgroundTransparency=1
  290. tl.Size=UDim2.new(1,0,1,0)
  291. tl.Text=text
  292. tl.TextColor3=color
  293. tl.TextScaled=true
  294. tl.Font="ArialBold"
  295. tl.Visible = false
  296. tl.Parent=bb
  297. bb.Parent=ep
  298. debris:AddItem(ep,time+.1)
  299. ep.Parent=game.Workspace
  300. delay(0,function()
  301. local frames=time/rate
  302. for frame=1,frames do
  303. wait(rate)
  304. local percent=frame/frames
  305. ep.CFrame=CFrame.new(pos)+Vector3.new(0,5*percent,0)
  306. tl.TextTransparency=percent
  307. end
  308. ep:remove()
  309. end)
  310. end
  311.  
  312. function makeblood(part)
  313. if part then
  314. local b=Instance.new("Part")
  315. b.BrickColor=BrickColor.new("Neon orange")
  316. b.formFactor="Custom"
  317. b.Transparency=math.random(0,1)*.5
  318. if math.random()<.5 then
  319. b.CanCollide=false
  320. else
  321. b.CanCollide=true
  322. end
  323. b.TopSurface="Smooth"
  324. b.BottomSurface="Smooth"
  325. b.Size=Vector3.new(.2*math.random(1,5),.2*math.random(1,5),.2*math.random(1,5))
  326. b.Velocity=part.Velocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*30)
  327. b.RotVelocity=part.RotVelocity+(Vector3.new((math.random()-.5),(math.random()-.5),(math.random()-.5))*20)
  328. b.CFrame=part.CFrame*CFrame.new((math.random()-.5)*3,(math.random()-.5)*3,(math.random()-.5)*3)*CFrame.Angles(math.pi*2*math.random(),math.pi*2*math.random(),math.pi*2*math.random())
  329. debris:AddItem(b,math.random()*4)
  330. b.Parent=game.Workspace
  331.  
  332. local burnbaby = Instance.new("Fire")
  333. burnbaby.Parent = b
  334. burnbaby.Size = 2
  335. burnbaby.Heat = 25
  336.  
  337. end
  338. end
  339.  
  340. sp.Handle.Touched:connect(function(hit)
  341. if ready and equipped and hit and hit.Parent~=nil and hit:IsDescendantOf(sp.Parent)==false and string.lower(string.sub(hit.Name,1,6))~="effect" and (tick()-lastswing)<=damagewindow then
  342. if hit:FindFirstChild("CanBlock") and sp.Handle:FindFirstChild("Blockable") then
  343. ready=false
  344. runsound(clashsounds[math.random(1,#clashsounds)])
  345. sparkles.Enabled=true
  346. delay(.2,function()
  347. sparkles.Enabled=false
  348. end)
  349. billboard(sp.Handle.Position,"Block",2,Color3.new(1,1,0))
  350. end
  351. local mh=sp.Parent:FindFirstChild("Humanoid")
  352. local eh=hit.Parent:FindFirstChild("Humanoid")
  353. local ra=sp.Parent:FindFirstChild("Right Arm")
  354. local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
  355. if mh and eh and eh~=mh and mh.Health>0 and eh.Health>0 and ra and plr~=nil then
  356. if not plr.Neutral then
  357. local eplr=game.Players:GetPlayerFromCharacter(eh.Parent)
  358. if eplr~=nil and eplr.Neutral==false and eplr.TeamColor==plr.TeamColor then
  359. return --No team killing
  360. end
  361. end
  362. ready=false
  363. for i,v in ipairs(eh:GetChildren()) do
  364. if v.Name=="creator" then
  365. v:remove()
  366. end
  367. end
  368. local creator=Instance.new("ObjectValue")
  369. creator.Name="creator"
  370. creator.Value=plr
  371. creator.Parent=eh
  372. debris:AddItem(creator,1)
  373. local localdamage=math.floor(damage*(.9+(math.random()*.2)))
  374. eh:TakeDamage(localdamage)
  375. billboard(hit.Position,"-"..tostring(localdamage))
  376. runsound(hitsounds[math.random(1,#hitsounds)])
  377. local bloodeffects=math.ceil(localdamage/10)
  378. for i=1,math.random(bloodeffects-1,bloodeffects+1) do
  379. --[[if math.random()<.5 then
  380. makeblood(sp.Handle)
  381. else]]
  382. makeblood(hit)
  383. --end
  384. end
  385. end
  386. end
  387. end)
  388.  
  389.  
  390. function Activate()
  391. if equipped and (tick()-lastswing)>=swingrate then
  392. ready=true
  393. reloading.Value=true
  394.  
  395. --script.Parent.Parent.Humanoid.WalkSpeed = 32
  396.  
  397. runsound(swooshsounds[math.random(1,#swooshsounds)],.5)
  398.  
  399. newanim=anims[math.random(1,#anims)]
  400. while newanim==runanim.Value do
  401. newanim=anims[math.random(1,#anims)]
  402. end
  403. runanim.Value=newanim
  404.  
  405. lastswing=tick()
  406. updategui()
  407.  
  408. wait(swingrate)
  409.  
  410. reloading.Value=false
  411.  
  412. --script.Parent.Parent.Humanoid.WalkSpeed = 16
  413.  
  414. if down.Value then
  415. Activate()
  416. end
  417. end
  418. end
  419.  
  420. down.Changed:connect(function()
  421. if down.Value then
  422. Activate()
  423. end
  424. end)
  425.  
  426. function updategui()
  427. local swingpercent=math.min((tick()-lastswing)/swingrate,1)
  428. if swingpercent<.5 then --fade from red to yellow then to green
  429. guibarfill.BackgroundColor3=Color3.new(1,swingpercent*2,0)
  430. else
  431. guibarfill.BackgroundColor3=Color3.new(1-((swingpercent-.5)/.5),1,0)
  432. end
  433. guibarfill.Size=UDim2.new(swingpercent,0,1,0)
  434. end
  435.  
  436. sp.Equipped:connect(function(mouse)
  437. lastswing=tick()
  438. updategui()
  439.  
  440. reloading.Value=true
  441. ready=false
  442. equipped=true
  443.  
  444. delay(0,function() --HAAB (Hacking around a bug)
  445. local plr=game.Players:GetPlayerFromCharacter(sp.Parent)
  446. if plr~=nil then
  447. local plrgui=plr:FindFirstChild("PlayerGui")
  448. if plrgui~=nil and weaponhud~=nil then
  449. weaponhud.Parent=plrgui
  450. while equipped do
  451. updategui()
  452. wait(rate)
  453. end
  454. end
  455. end
  456. end)
  457.  
  458. wait(swingrate)
  459.  
  460. reloading.Value=false
  461. if down.Value then
  462. Activate()
  463. end
  464. end)
  465.  
  466. sp.Unequipped:connect(function()
  467. ready=false
  468. equipped=false
  469. delay(0,function() --HAAB
  470. weaponhud.Parent=sp
  471. end)
  472. end)
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481. end))
  482. ScreenGui16.Name = "WeaponHud"
  483. ScreenGui16.Parent = Tool0
  484. Frame17.Name = "Bar"
  485. Frame17.Parent = ScreenGui16
  486. Frame17.Size = UDim2.new(0, 200, 0, 40)
  487. Frame17.Style = Enum.FrameStyle.RobloxRound
  488. Frame17.Position = UDim2.new(0.5, -100, 1, -160)
  489. Frame17.Visible = false
  490. Frame17.ZIndex = 4
  491. Frame18.Name = "Fill"
  492. Frame18.Parent = Frame17
  493. Frame18.Size = UDim2.new(1, 0, 1, 0)
  494. Frame18.BackgroundColor3 = Color3.new(0, 1, 0)
  495. Frame18.BorderSizePixel = 0
  496. Frame18.ZIndex = 5
  497. Frame19.Name = "Backing"
  498. Frame19.Parent = Frame17
  499. Frame19.Size = UDim2.new(1, 0, 1, 0)
  500. Frame19.BackgroundColor3 = Color3.new(0, 0, 0)
  501. Frame19.BorderSizePixel = 0
  502. Frame19.ZIndex = 4
  503. TextLabel20.Name = "WeaponName"
  504. TextLabel20.Parent = ScreenGui16
  505. TextLabel20.Transparency = 1
  506. TextLabel20.Size = UDim2.new(0, 400, 0, 20)
  507. TextLabel20.Text = "Dagger"
  508. TextLabel20.Position = UDim2.new(0.5, -200, 1, -185)
  509. TextLabel20.Visible = false
  510. TextLabel20.BackgroundTransparency = 1
  511. TextLabel20.BorderSizePixel = 0
  512. TextLabel20.ZIndex = 4
  513. TextLabel20.ClipsDescendants = true
  514. TextLabel20.Font = Enum.Font.ArialBold
  515. TextLabel20.FontSize = Enum.FontSize.Size18
  516. TextLabel20.TextColor3 = Color3.new(0, 0, 0)
  517. TextLabel20.TextStrokeColor3 = Color3.new(0.698039, 0.698039, 0.698039)
  518. TextLabel20.TextTransparency = 0.20000000298023
  519. Script21.Name = "Poison"
  520. Script21.Parent = Tool0
  521. Script21.Disabled = true
  522. table.insert(cors,sandbox(Script21,function()
  523. function Poison()
  524.  
  525. local character = script.Parent
  526. local humanoid = character:FindFirstChild("Humanoid")
  527.  
  528. local burnbaby = Instance.new("Fire")
  529. burnbaby.Parent = script.Parent.Torso
  530. burnbaby.Heat = 25
  531. burnbaby.Size = 12.5
  532.  
  533. if (character:FindFirstChild("ForceField") ~= nil) then return end
  534.  
  535.  
  536. local childs = character:GetChildren()
  537.  
  538. local colors = {}
  539.  
  540. for i=1,#childs do
  541. if (childs[i].className == "Part") then
  542. colors[i] = childs[i].BrickColor
  543. childs[i].BrickColor = BrickColor.new(26)
  544. end
  545. end
  546.  
  547. wait(1)
  548.  
  549. for i=1,#childs do
  550. if (childs[i].className == "Part") then
  551. childs[i].BrickColor = colors[i]
  552. end
  553. end
  554.  
  555.  
  556. --tagHumanoid(humanoid, attacker)
  557. humanoid:TakeDamage(humanoid.MaxHealth / 8)
  558. wait(1)
  559. --untagHumanoid(humanoid)
  560.  
  561.  
  562. end
  563.  
  564.  
  565. for i=1,5 do
  566. Poison()
  567. wait(.2)
  568. end
  569.  
  570. script.Parent = nil
  571. end))
  572. Script22.Name = "SwordScript"
  573. Script22.Parent = Tool0
  574. table.insert(cors,sandbox(Script22,function()
  575. -------- OMG HAX
  576.  
  577. r = game:service("RunService")
  578.  
  579.  
  580. local damage = 5
  581.  
  582.  
  583. local slash_damage = 10
  584. local lunge_damage = 20
  585.  
  586. sword = script.Parent.Handle
  587. Tool = script.Parent
  588.  
  589.  
  590. local SlashSound = Instance.new("Sound")
  591. SlashSound.SoundId = "http://www.roblox.com/asset/?id=165344304"
  592. SlashSound.Parent = sword
  593. SlashSound.Volume = .7
  594. SlashSound.Pitch = .7
  595.  
  596. local LungeSound = Instance.new("Sound")
  597. LungeSound.SoundId = "http://www.roblox.com/asset/?id=186112111"
  598. LungeSound.Parent = sword
  599. LungeSound.Volume = .6
  600. LungeSound.Pitch = .8
  601.  
  602. local UnsheathSound = Instance.new("Sound")
  603. UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=145486992"
  604. UnsheathSound.Parent = sword
  605. UnsheathSound.Volume = 1
  606. UnsheathSound.Pitch = .7
  607.  
  608. function Poison(character, attacker)
  609.  
  610. if (character:FindFirstChild("ForceField") ~= nil) then return end
  611. if (character:FindFirstChild("Poison") == nil ) then
  612. local s = script.Parent.Poison:clone()
  613. s.Disabled = false
  614. s.Parent = character
  615.  
  616. end
  617.  
  618. end
  619.  
  620.  
  621.  
  622.  
  623. function blow(hit)
  624. local humanoid = hit.Parent:findFirstChild("Humanoid")
  625. local vCharacter = Tool.Parent
  626. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  627. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  628. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  629. -- final check, make sure sword is in-hand
  630.  
  631. local right_arm = vCharacter:FindFirstChild("Right Arm")
  632. if (right_arm ~= nil) then
  633. local joint = right_arm:FindFirstChild("RightGrip")
  634. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  635. Poison(humanoid.Parent, attacker)
  636. tagHumanoid(humanoid, vPlayer)
  637. humanoid:TakeDamage(damage)
  638. wait(1)
  639. untagHumanoid(humanoid)
  640. end
  641. end
  642.  
  643.  
  644. end
  645. end
  646.  
  647.  
  648.  
  649. function tagHumanoid(humanoid, player)
  650. local creator_tag = Instance.new("ObjectValue")
  651. creator_tag.Value = player
  652. creator_tag.Name = "creator"
  653. creator_tag.Parent = humanoid
  654. end
  655.  
  656. function untagHumanoid(humanoid)
  657. if humanoid ~= nil then
  658. local tag = humanoid:findFirstChild("creator")
  659. if tag ~= nil then
  660. tag.Parent = nil
  661. end
  662. end
  663. end
  664.  
  665.  
  666. function attack()
  667. damage = slash_damage
  668. SlashSound:play()
  669. local anim = Instance.new("StringValue")
  670. anim.Name = "toolanim"
  671. anim.Value = "Slash"
  672. anim.Parent = Tool
  673. script.Parent.Parent.Humanoid.WalkSpeed = 32
  674. wait(.5)
  675. script.Parent.Parent.Humanoid.WalkSpeed = 16
  676. end
  677.  
  678. function lunge()
  679. damage = lunge_damage
  680.  
  681. LungeSound:play()
  682.  
  683. local anim = Instance.new("StringValue")
  684. anim.Name = "toolanim"
  685. anim.Value = "Lunge"
  686. anim.Parent = Tool
  687. script.Parent.Parent.Humanoid.WalkSpeed = 32
  688. wait(.5)
  689. script.Parent.Parent.Humanoid.WalkSpeed = 16
  690.  
  691.  
  692. local force = Instance.new("BodyVelocity")
  693. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  694. force.Parent = Tool.Parent.Torso
  695. wait(.25)
  696. swordOut()
  697. wait(.25)
  698. force.Parent = nil
  699. wait(.5)
  700. swordUp()
  701.  
  702. damage = slash_damage
  703. end
  704.  
  705. function swordUp()
  706. Tool.GripForward = Vector3.new(0, 0, -1)
  707. Tool.GripRight = Vector3.new(1, -0, 0)
  708. Tool.GripUp = Vector3.new(0, 1, 0)
  709. end
  710.  
  711. function swordOut()
  712. Tool.GripForward = Vector3.new(0, 0, -1)
  713. Tool.GripRight = Vector3.new(1, -0, 0)
  714. Tool.GripUp = Vector3.new(0, 1, 0)
  715. end
  716.  
  717. function swordAcross()
  718. -- parry
  719. end
  720.  
  721.  
  722. Tool.Enabled = true
  723. local last_attack = 0
  724. function onActivated()
  725.  
  726. if not Tool.Enabled then
  727. return
  728. end
  729.  
  730. Tool.Enabled = false
  731.  
  732. local character = Tool.Parent;
  733. local humanoid = character.Humanoid
  734. if humanoid == nil then
  735. print("Humanoid not found")
  736. return
  737. end
  738.  
  739. t = r.Stepped:wait()
  740.  
  741. if (t - last_attack < 2) then
  742. lunge()
  743. else
  744. attack()
  745. end
  746.  
  747. last_attack = t
  748.  
  749. --wait(.5)
  750.  
  751. Tool.Enabled = true
  752. end
  753.  
  754.  
  755. function onEquipped()
  756. UnsheathSound:play()
  757. end
  758.  
  759.  
  760. script.Parent.Activated:connect(onActivated)
  761. script.Parent.Equipped:connect(onEquipped)
  762.  
  763.  
  764. connection = sword.Touched:connect(blow)
  765.  
  766.  
  767.  
  768. end))
  769. Script23.Name = "UltimateWeld"
  770. Script23.Parent = Tool0
  771. table.insert(cors,sandbox(Script23,function()
  772. --DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
  773. --The regular script is recommended
  774.  
  775.  
  776.  
  777. --[[
  778. Prevents welds from breaking/transforming when player uses the tool
  779. This recreates the EXACT weld every time
  780. This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new
  781. ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
  782. ]]
  783.  
  784. --[[Usage
  785. 1. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
  786. 2. Anchor all parts of tool and put inside of a tool object
  787. 3. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
  788. 4. Treat like normal tool, nothing special has to be done with it
  789. ]]
  790.  
  791. --[[The local script included in this model can only be used if
  792. 1. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
  793. OR
  794. 2. The weapon is previously welded (weapon can be placed in workspace and picked up then)
  795. ]]
  796. repeat wait() until script.Parent:FindFirstChild("Handle")
  797. local welds={}
  798. function ClearOldWelds(tbl)
  799. for _,v in pairs(tbl) do
  800. if v:IsA('Weld') then
  801. v:Destroy()
  802. end
  803. end
  804. end
  805.  
  806. function Equipped()
  807. local handle=script.Parent:FindFirstChild('Handle')
  808. if not handle then return end
  809. local tble=handle:GetChildren()
  810. for _,v in pairs(script.Parent:GetChildren()) do
  811. if v:IsA('BasePart') and v~=handle then
  812. local c1
  813. for _1,v1 in pairs(welds) do
  814. if _1==v then
  815. c1=v1
  816. break
  817. end
  818. end
  819. if not c1 then
  820. welds[v]=v.CFrame:inverse()*handle.CFrame
  821. v.Anchored=false
  822. c1=welds[v]
  823. end
  824. local weld=Instance.new('Weld')
  825. weld.Part0=handle
  826. weld.Part1=v
  827. weld.C0=CFrame.new()
  828. weld.C1=c1
  829. weld.Parent=handle
  830. end
  831. end
  832. ClearOldWelds(tble)
  833. handle.Anchored=false
  834. end
  835. Equipped()
  836. script.Parent.Equipped:connect(Equipped)
  837.  
  838. --Made by DonnyTheDemented
  839.  
  840. end))
  841. for i,v in pairs(mas:GetChildren()) do
  842. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  843. pcall(function() v:MakeJoints() end)
  844. end
  845. mas:Destroy()
  846. for i,v in pairs(cors) do
  847. spawn(function()
  848. pcall(v)
  849. end)
  850. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement