local h=false local k={}local V={BrickColor.new("\082\101\097\108\108\121 \114\101\100"),BrickColor.new("\076\105\109\101 \103\114\101\101\110"),BrickColor.new("\084\111\111\116\104\112\097\115\116\101")}local O={Vector3.new(-0.45,0,0),Vector3.new(0,0,0);Vector3.new(.45,0,0)}local z=nil local y local J={function(h,k)h:TakeDamage(1)end;function(h,k)h:TakeDamage(-1)end;function(h,k)if h.Torso then local V=Instance.new("\066\111\100\121\070\111\114\099\101")V.force=k*100 V.Parent=h.Torso h.Sit=true game.Debris:AddItem(V,.2)Delay(.2,function()h.Sit=false end)end end}Tool.Equipped:connect(function(G)Spawn(function()local M=1 if not Tool.Parent:FindFirstChild("\084\111\114\115\111")or not Tool.Parent.Torso:FindFirstChild("\082\105\103\104\116 \083\104\111\117\108\100\101\114")or not Tool.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")then return end LazerSound:Play()y=Tool.Parent.Torso["\082\105\103\104\116 \083\104\111\117\108\100\101\114"]z=y.C0 y.CurrentAngle=0 y.DesiredAngle=0 y.MaxVelocity=0 G.Button1Down:connect(function()M=M+1 if M>#V then M=1 end LazerSound.Pitch=.75+(M*.25)*3 end)h=true while h and Tool.Parent:FindFirstChild("\084\111\114\115\111")do local h=Tool.Parent.Torso.CFrame h=h+h:vectorToWorldSpace(Vector3.new(1,.5,0))local z=G.Hit.p-h.p y.C0=CFrame.new(Vector3.new(),h:vectorToObjectSpace(z))*CFrame.Angles(0,math.pi/2,0)+Vector3.new(1,.5,0)k=CastLightRay(Handle.CFrame.p+Handle.CFrame:vectorToWorldSpace(O[M]),G.Hit.p,V[M],5,.2,k,J[M])LazerSound.Volume=(math.sin(tick()*3)+1)*.25+.25 wait()end y.C0=z LazerSound:Stop()end)end)Tool.Unequipped:connect(function(V)h=false LazerSound:Stop()for h=1,50,1 do if k[h]then k[h]:Destroy()k[h]=nil end end if y then y.MaxVelocity=.15 y.C0=z end end)
--[[Running Logic]]
--
local equipped = false
local rayparts = {}
local ColorChoices = { BrickColor.new("Really red"), BrickColor.new("Lime green"), BrickColor.new("Toothpaste") }
local StartOffset = { Vector3.new(-0.45, 0, 0), Vector3.new(0, 0, 0), Vector3.new(0.45, 0, 0) }
local oldC0 = nil
local nweld
local EffectFunctions = {
	function(hum, dir)
		hum:TakeDamage(1)
	end,
	function(hum, dir)
		hum:TakeDamage(-1)
	end,
	function(hum, dir)
		if hum.Torso then
			local nforce = Instance.new("BodyForce")
			nforce.force = dir * 100
			nforce.Parent = hum.Torso
			hum.Sit = true
			game.Debris:AddItem(nforce, 0.2)
			Delay(0.2, function()
				hum.Sit = false
			end)
		end
	end,
}
Tool.Equipped:connect(function(mouse)
	--game.Players.LocalPlayer:GetMouse()
	Spawn(function()
		local colorChoice = 1
		if
			not Tool.Parent:FindFirstChild("Torso")
			or not Tool.Parent.Torso:FindFirstChild("Right Shoulder")
			or not Tool.Parent:FindFirstChild("Humanoid")
		then
			return
		end
		LazerSound:Play()
		nweld = Tool.Parent.Torso["Right Shoulder"]
		oldC0 = nweld.C0
		nweld.CurrentAngle = 0
		nweld.DesiredAngle = 0
		nweld.MaxVelocity = 0
		mouse.Button1Down:connect(function()
			colorChoice = colorChoice + 1
			if colorChoice > #ColorChoices then
				colorChoice = 1
			end
			LazerSound.Pitch = 0.75 + ((colorChoice * 0.25) * 3)
		end)
		equipped = true
		while equipped and Tool.Parent:FindFirstChild("Torso") do
			local tframe = Tool.Parent.Torso.CFrame
			tframe = tframe + tframe:vectorToWorldSpace(Vector3.new(1, 0.5, 0))
			local taim = mouse.Hit.p - tframe.p
			nweld.C0 = (CFrame.new(Vector3.new(), tframe:vectorToObjectSpace(taim)) * CFrame.Angles(0, math.pi / 2, 0))
				+ Vector3.new(1, 0.5, 0)
			rayparts = CastLightRay(
				Handle.CFrame.p + Handle.CFrame:vectorToWorldSpace(StartOffset[colorChoice]),
				mouse.Hit.p,
				ColorChoices[colorChoice],
				5,
				0.2,
				rayparts,
				EffectFunctions[colorChoice]
			)
			LazerSound.Volume = ((math.sin(tick() * 3) + 1) * 0.25) + 0.25
			wait()
		end
		nweld.C0 = oldC0
		LazerSound:Stop()
	end)
end)

Tool.Unequipped:connect(function(mouse)
	equipped = false
	LazerSound:Stop()
	for i = 1, 50, 1 do
		if rayparts[i] then
			rayparts[i]:Destroy()
			rayparts[i] = nil
		end
	end
	if nweld then
		nweld.MaxVelocity = 0.15
		nweld.C0 = oldC0
	end
end)
