Advertisement
xXjoethebestXx

Sword script

Apr 7th, 2015
1,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. --collinthecoolkid made this
  2.  
  3. local sword = Instance.new("Tool", game.Players.collinthecoolkid.Backpack) sword.Name = "Sword" sword.TextureId = "rbxasset://Textures/Sword128.png"
  4. sword.GripForward = Vector3.new(-1,0,0)
  5. sword.GripPos = Vector3.new(0,0,-1.5)
  6. sword.GripRight = Vector3.new(0,1,0)
  7. sword.GripUp = Vector3.new(0,0,1)
  8. local handle = Instance.new("Part", sword) handle.Name = "Handle" handle.FormFactor = "Plate" handle.Size = Vector3.new(1,.8,4) handle.TopSurface = 0 handle.BottomSurface = 0
  9. local msh = Instance.new("SpecialMesh", handle) msh.MeshId = "rbxasset://fonts/sword.mesh" msh.TextureId = "rbxasset://textures/SwordTexture.png"
  10. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  11. local Damage = 999
  12. local SlashSound = Instance.new("Sound", script.Parent.Handle)
  13. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  14. SlashSound.Volume = 1
  15. local LungeSound = Instance.new("Sound", script.Parent.Handle)
  16. LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
  17. LungeSound.Volume = 1
  18. local UnsheathSound = Instance.new("Sound", script.Parent.Handle)
  19. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  20. UnsheathSound.Volume = 1
  21. local last = 0
  22. script.Parent.Handle.Touched:connect(function(hit)
  23. if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") and game.Players:findFirstChild(hit.Parent.Name) and game.Players.LocalPlayer.Character.Humanoid.Health > 100 and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
  24. local tag = Instance.new("ObjectValue", hit.Parent.Humanoid) tag.Value = plr1 tag.Name = "creator" game:service("Debris"):AddItem(tag, 3)
  25. hit.Parent.Humanoid:TakeDamage(999)
  26. end
  27. end)
  28. script.Parent.Activated:connect(function()
  29. if not script.Parent.Enabled or game.Players.LocalPlayer.Character.Humanoid.Health <= 0 then return end
  30. script.Parent.Enabled = false
  31. local tick = game:service("RunService").Stepped:wait()
  32. if tick - last <= .2 then
  33. LungeSound:play()
  34. local lunge = Instance.new("StringValue", script.Parent) lunge.Name = "toolanim" lunge.Value = "Lunge"
  35. local frc = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.Torso) frc.Name = "SwordForce" frc.velocity = Vector3.new(0,10,0)
  36. wait(.2)
  37. script.Parent.GripForward = Vector3.new(0,0,1)
  38. script.Parent.GripRight = Vector3.new(0,-1,0)
  39. script.Parent.GripUp = Vector3.new(-1,0,0)
  40. wait(.3)
  41. frc:Destroy() wait(.5)
  42. script.Parent.GripForward = Vector3.new(-1,0,0)
  43. script.Parent.GripRight = Vector3.new(0,1,0)
  44. script.Parent.GripUp = Vector3.new(0,0,1)
  45. else
  46. SlashSound:play()
  47. local slash = Instance.new("StringValue", script.Parent) slash.Name = "toolanim" slash.Value = "Slash"
  48. end
  49. last = tick
  50. script.Parent.Enabled = true
  51. end)
  52. script.Parent.Equipped:connect(function(mouse)
  53. for i,v in pairs(game.Players.LocalPlayer.Character.Torso:children()) do if v.Name == "SwordForce" then v:Destroy() end end
  54. UnsheathSound:play()
  55. script.Parent.Enabled = true
  56. if not mouse then return end
  57. mouse.Icon = "http://www.roblox.com/asset/?id=103593352"
  58. end)]] cl.Disabled = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement