So the wiki page about making your own ray cast laser gun got changed to this: https://developer.roblox.com/en-us/articles/Raycasting I'm trying to find the script in it that made the raycast laser. Does anyone happen to have that script?
✓ ANSWER ACCEPTED
Does anyone have the wiki laser gun script?
1 answer
✓ Accepted answer
It seems they have removed that page on the API which is sad because it was very helpful to a lot of people.
Luckily, I happened to have a version of that script so I tried to revert it back to its "original" state. Here you go.
local ray = Ray.new(Handle.CFrame.p, (MouseHit.p - tool.Parent.Ship.CFrame.p).unit * 100)
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
local beam = Instance.new("Part", workspace)
beam.BrickColor = BrickColor.new("Really red")
beam.FormFactor = "Custom"
beam.Material = "Neon"
beam.Transparency = 0.5
beam.Anchored = true
beam.Locked = true
beam.CanCollide = false
local distance = (Handle.CFrame.p - position).magnitude
beam.Size = Vector3.new(0.3, 0.3, distance)
beam.CFrame = CFrame.new(tool.Parent.Ship.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
game:GetService("Debris"):AddItem(beam, 0.1)
The damaging segment was just a condition if part exists and if the humanoid was found in the part's parent.
Hope this was of some use to you.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I don't exactly have it, but a while back i create a pistol using that script, you can download it and take what you need - https://www.roblox.com/library/4927927170/Pistol-M9