Advertisement
StoppingGuy

Roblox Sword Script

Sep 9th, 2019
54,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. -- Sword Script
  2. local user = game.Players.LocalPlayer.Backpack
  3. local sword = Instance.new("Tool",user)
  4. local handle = Instance.new("Part",sword)
  5. local mesh = Instance.new("SpecialMesh",handle)
  6. local DAMAGE = 35
  7. local sound = Instance.new("Sound",handle)
  8. local sound2 = Instance.new("Sound",handle)
  9. sword.Name = "Sword"
  10. script.Parent = sword
  11. script.Name = "SwordScript"
  12. --local animation = Instance.new("Animation",script)
  13.  
  14. --animation.AnimationId = "http://www.roblox.com/Asset?ID=992817684"
  15.  
  16. sound.SoundId = "rbxasset://sounds//swordlunge.wav"
  17. sound.Volume = 3
  18. sound.PlaybackSpeed = 1.17
  19. sound.Name = "Slash"
  20. sound2.SoundId = "rbxasset://sounds//unsheath.wav"
  21. sound2.Volume = 3
  22. sound2.PlaybackSpeed = 0.8
  23. sound2.Volume = 3
  24. sound2.Name = "Unsheath"
  25.  
  26. function unsheathanimation()
  27. sword.GripPos = sword.GripPos + Vector3.new(0,5,0)
  28. for i = 1,5 do
  29. sword.GripPos = sword.GripPos + Vector3.new(0,-1,0)
  30. wait (0.1)
  31. end
  32. end
  33.  
  34. function unsheathsound()
  35. sound2:Play()
  36. end
  37.  
  38. function damage(hit)
  39.  
  40. local h = hit.Parent:FindFirstChild("Humanoid")
  41. if (h ~= nil) then
  42. h:TakeDamage(DAMAGE / 4)
  43. end
  44. end
  45.  
  46. function animate()
  47. --4
  48. sound:Play()
  49. for i = 1,5 do
  50. sword.GripUp = sword.GripUp + Vector3.new(0,0,1)
  51. wait (0)
  52. end
  53. sword.GripUp = sword.GripUp + Vector3.new(0,0,-1)
  54. end
  55. handle.Size = handle.Size + Vector3.new(-4,-1,-2)
  56. handle.Size = handle.Size + Vector3.new(0.6, 3.6, 0.4)
  57. handle.Name = "Handle"
  58.  
  59. mesh.MeshType = "FileMesh"
  60. mesh.MeshId = "http://www.roblox.com/asset/?id=94746028"
  61. mesh.TextureId = "http://www.roblox.com/asset/?ID=94746105"
  62. mesh.Offset = mesh.Offset + Vector3.new(0,1,0)
  63.  
  64. sword.Equipped:connect(unsheathanimation)
  65. sword.Equipped:connect(unsheathsound)
  66. wait(sound2.TimeLength)
  67. sword.Activated:connect(animate)
  68. handle.Touched:connect(damage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement