HaxRoblox

PAsta

Oct 12th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Player = game.Players.LocalPlayer
  2. Mouse = Player:GetMouse()
  3.  
  4. local firing = false
  5.  
  6. function Firing() -- call this after
  7. repeat wait()
  8. plr = game.Players.LocalPlayer --Variable
  9. plr.Character.Humanoid.Animator:Destroy() --Destroy anim (if idle changed)
  10. local t = Instance.new('Sound' ,game.Workspace) --(Variable making sound + properties if need.)
  11. t.SoundId = 'http://www.roblox.com/asset/?id=2248511' --(Selecting the sound from roblox/develop/library*Sounds/(ID)
  12. local Mouse = plr:GetMouse() --(Getmous)
  13. Mouse.KeyDown:connect(function(Key) --Function
  14. Key = Key:lower() --(getting keys)
  15. if Key == 'e' then --which button pressed
  16. plr.Character.Humanoid.WalkSpeed = 100
  17. local h = Instance.new('Part' ,game.Workspace) --making part
  18. h.Material = 'Neon' --properties from variable 'h'
  19. h.CanCollide = false
  20. h.Name = 'Bullet'
  21. h.BrickColor = BrickColor.new('Lime green')
  22. h.Size = Vector3.new(1,1,4)
  23. h.Anchored = true
  24. h.CFrame = plr.Character.Torso.CFrame * CFrame.new(0,0,-4.3)
  25. local function ontouch(hit) --when touched (what it hits)
  26. local r = Instance.new('Explosion' ,game.Workspace) --making explosion
  27. r.ExplosionType = 'NoCraters' --properties of variable r
  28. r.BlastRadius = 0
  29. r.Position = Vector3.new(h.Position.X,h.Position.Y,h.Position.Z)
  30. h:Destroy() --Destroying the variable
  31. hit.Parent.Humanoid.Health = 0
  32. hit:BreakJoints() --breaking joint
  33. t.Playing = true
  34.  
  35. end
  36. h.Touched:connect(ontouch)
  37. while true do wait()
  38. h.CFrame = h.CFrame * CFrame.new(0,0,-3.4)
  39.  
  40. end
  41. end
  42. end)
  43.  
  44. until firing == false
  45. end
  46.  
  47. Mouse.KeyDown:connect(function(key)
  48. Key = key:lower()
  49. if Key == "f" then
  50. firing = true
  51.  
  52. Firing() -- call the function
  53. end
  54. end)
  55.  
  56. Mouse.KeyUp:connect(function()
  57. firing = false
  58. end)
Add Comment
Please, Sign In to add comment