Advertisement
HenloMyDude

LinkedSword

Jun 23rd, 2019
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. --LINKEDSWORD BY HENLOMYDUDE--
  2. print("LinkedSword by HenloMyDude")
  3.  
  4. --TOOL SETUP--
  5. tool = Instance.new("Tool")
  6. tool.Parent = owner.Backpack
  7. tool.Name = "ClassicSword"
  8. tool.ToolTip = "Original gear made by roblox. Converted to script by HenloMyDude"
  9. tool.TextureId = "rbxasset://Textures/Sword128.png"
  10. tool.GripForward = Vector3.new(-1, 0, 0)
  11. tool.GripPos = Vector3.new(0, 0, -1.5)
  12. tool.GripRight = Vector3.new(0, 1, 0)
  13. tool.GripUp = Vector3.new(0, 0, 1)
  14. handle = Instance.new("Part",tool)
  15. handle.Name = "Handle"
  16. handle.Size = Vector3.new(1, 0.8, 4)
  17. handle.Reflectance = 0.4
  18. handle.BrickColor = BrickColor.new("Dark stone grey")
  19. mesh = Instance.new("SpecialMesh",handle)
  20. mesh.Name = "Mesh"
  21. mesh.MeshType = "FileMesh"
  22. mesh.MeshId = "rbxasset://fonts/sword.mesh"
  23. mesh.TextureId = "rbxasset://textures/SwordTexture.png"
  24. swordlunge = Instance.new("Sound",handle)
  25. swordlunge.Name = "SwordLunge"
  26. swordlunge.Volume = 0.6
  27. swordlunge.SoundId = "http://www.roblox.com/asset/?id=12222208"
  28. swordslash = Instance.new("Sound",handle)
  29. swordslash.Name = "SwordSlash"
  30. swordslash.Volume = 0.7
  31. swordslash.SoundId = "http://www.roblox.com/asset/?id=12222216"
  32. unsheath = Instance.new("Sound",handle)
  33. unsheath.Name = "Unsheath"
  34. unsheath.Volume = 1
  35. unsheath.SoundId = "http://www.roblox.com/asset/?id=12222225"
  36.  
  37. --SCRIPTS--
  38.  
  39. Grips = {
  40. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  41. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  42. }
  43.  
  44. tool.Equipped:connect(function()
  45. unsheath:Play()
  46. end)
  47.  
  48. basic = false
  49. lunge = false
  50. attackd = false
  51.  
  52. tool.Activated:connect(function()
  53. if attackd == false then
  54. basic = true
  55. lunge = false
  56. attackd = true
  57. swordslash:Play()
  58. local weld = Instance.new("Weld",owner.Character["Right Arm"])
  59. weld.Part0 = owner.Character["Right Arm"]
  60. weld.Part1 = owner.Character["Torso"]
  61. weld.C0 = CFrame.new(-1.5, 0, 0)
  62. weld.C1 = CFrame.Angles(-80, 0, 0)
  63. wait(0.0000001)
  64. weld.C1 = CFrame.Angles(70, 0, 0)
  65. wait(0.0000001)
  66. weld.C1 = CFrame.Angles(50, 0, 0)
  67. wait(0.3)
  68. weld.C1 = CFrame.Angles(70, 0, 0)
  69. wait(0.0000001)
  70. weld.C1 = CFrame.Angles(-80, 0, 0)
  71. wait(0.0000001)
  72. weld:Destroy()
  73. attackd = false
  74. end
  75. end)
  76.  
  77. tool.Activated:connect(function()
  78. if attackd == true then
  79. lunge = true
  80. basic = false
  81. attackd = true
  82. tool.Grip = Grips.Out
  83. swordlunge:Play()
  84. local weld = Instance.new("Weld",owner.Character["Right Arm"])
  85. weld.Part0 = owner.Character["Right Arm"]
  86. weld.Part1 = owner.Character["Torso"]
  87. weld.C0 = CFrame.new(-1.5, 0, 0)
  88. weld.C1 = CFrame.Angles(-80, 0, 0)
  89. wait(1)
  90. attackd = false
  91. tool.Grip = Grips.Up
  92. weld:Destroy()
  93. end
  94. end)
  95.  
  96. handle.Touched:connect(function(hit)
  97. if attackd == true then
  98. for _,v in pairs(hit.Parent:children()) do
  99. if v:IsA("Humanoid") then
  100. if basic then
  101. v.Health = v.Health - 5
  102. elseif lunge then
  103. v.Health = v.Health - 15
  104. end
  105. end
  106. end
  107. end
  108. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement