Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BouyertheDestroyer
- --[[
- Instructions:
- Just paste this script into any Tool with a Handle to get a laser to help aim.
- Thats about it. Change the Range to whatever you like. I am not sure
- if the fade factor will still work if you make the range extremely low or high.
- Anyways, physics are NOT enabled for this. Meaning gravity does not
- apply. I will probably make another one that can compute gravity in the
- future.
- --]]
- Tool = script.Parent
- Range = 25
- local Dir = Vector3.new(0,0,0)
- for LaserCount = 1, Range do
- local Laser = Instance.new("Part")
- Laser.Parent = Tool
- Laser.Name = "Laser"
- Laser.Locked = true
- Laser.Anchored = true
- Laser.CanCollide = false
- Laser.Shape = 0
- Laser.Size = Vector3.new(1,1,1)
- Laser.BrickColor = BrickColor.Blue()
- Laser.Transparency = LaserCount / Range -- Fade Factor
- Laser.TopSurface = 0
- Laser.BottomSurface = 0
- end
- while true do
- wait()
- local Humanoid = Tool.Parent:findFirstChild("Humanoid")
- if Humanoid ~= nil then
- Dir = (Humanoid.TargetPoint - Tool.Handle.Position).unit
- end
- local Lasers = Tool:GetChildren()
- for Range = 1, # Lasers do
- if Lasers[Range].Name == "Laser" then
- Lasers[Range].CFrame = CFrame.new(Tool.Handle.Position + Dir * (Range - 1))
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement