George148

lazer

May 29th, 2015
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild('Head') and game.Players.LocalPlayer:GetMouse()
  2. local plr = game.Players.LocalPlayer
  3. local char = plr.Character
  4. local head = char.Head
  5. local mouse = plr:GetMouse()
  6.  
  7. mouse.Button1Down:connect(function()local s = Instance.new("Sound")
  8.  
  9. s.Name = "Sound"
  10. s.SoundId = "http://www.roblox.com/asset/?id=186130717"
  11. s.Volume = 1
  12. s.Pitch = 1 -- The higher this number the faster the sound, the lower the slower
  13.  
  14. s.Looped = false
  15. s.PlayOnRemove = false
  16. s.Archivable = false
  17.  
  18. s.Parent = game.Workspace
  19.  
  20. wait(0)
  21.  
  22. s:play()
  23. wait(0.5)
  24. s:remove()
  25. local s,f = head.Position,mouse.Hit.p
  26. local hit,pos = workspace:FindPartOnRayWithIgnoreList(Ray.new(s,(f-s).unit*999),char:children())
  27. local dist = (s-pos).magnitude
  28. local lastp = s
  29. for i = 1,10 do
  30. local newp = (CFrame.new(s,pos)*CFrame.new(0,0,-i*(dist/10))).p+Vector3.new(math.random(-50,50)/20,math.random(-50,50)/20,math.random(-50,50)/20)
  31. local newdist = (lastp-newp).magnitude
  32. local p = Instance.new('Part',char) game:service('Debris'):AddItem(p,.5)
  33. p.Anchored = true
  34. p.CanCollide = false
  35. p.TopSurface = 0
  36. p.BottomSurface = 0
  37. p.formFactor = 3
  38. p.Reflectance = .3
  39. p.Transparency = .3
  40. p.BrickColor = BrickColor.new('New Yeller')
  41. p.Size = Vector3.new(.2,.2,newdist)
  42. p.CFrame = CFrame.new(lastp,newp)*CFrame.new(0,0,-newdist/2)
  43. lastp = newp
  44.  
  45. end
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment