Advertisement
KINGOFCOOL

Untitled

Jan 9th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. -- BouyertheDestroyer
  2.  
  3. --[[
  4.  
  5. Instructions:
  6.  
  7. Just paste this script into any Tool with a Handle to get a laser to help aim.
  8. Thats about it. Change the Range to whatever you like. I am not sure
  9. if the fade factor will still work if you make the range extremely low or high.
  10. Anyways, physics are NOT enabled for this. Meaning gravity does not
  11. apply. I will probably make another one that can compute gravity in the
  12. future.
  13.  
  14. --]]
  15.  
  16. Tool = script.Parent
  17. Range = 25
  18. local Dir = Vector3.new(0,0,0)
  19.  
  20. for LaserCount = 1, Range do
  21. local Laser = Instance.new("Part")
  22. Laser.Parent = Tool
  23. Laser.Name = "Laser"
  24. Laser.Locked = true
  25. Laser.Anchored = true
  26. Laser.CanCollide = false
  27. Laser.Shape = 0
  28. Laser.Size = Vector3.new(1,1,1)
  29. Laser.BrickColor = BrickColor.Blue()
  30. Laser.Transparency = LaserCount / Range -- Fade Factor
  31. Laser.TopSurface = 0
  32. Laser.BottomSurface = 0
  33. end
  34.  
  35. while true do
  36. wait()
  37. local Humanoid = Tool.Parent:findFirstChild("Humanoid")
  38. if Humanoid ~= nil then
  39. Dir = (Humanoid.TargetPoint - Tool.Handle.Position).unit
  40. end
  41. local Lasers = Tool:GetChildren()
  42. for Range = 1, # Lasers do
  43. if Lasers[Range].Name == "Laser" then
  44. Lasers[Range].CFrame = CFrame.new(Tool.Handle.Position + Dir * (Range - 1))
  45. end
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement