Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ 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.