I need help with gun pls help (fe gun kit beam gun)

What do you want to achieve?

Theres a flying beam that i want it to disseapear
I was making a system where if the beam (tool) is equipped after a certain time the tool will be destroyed.

What is the issue?

What solutions have you tried so far?

At first when the tool gets destroyed the viewmodel is still there so i tried to delete the viewmodel from the camera and the beam.

i tried deleting the cylindersegment in camera but theres still a particle in the end of the beam that i dont know where its located in.

Code:

local tool = script.Parent
local foldervm = game.Workspace.Camera:WaitForChild("ViewmodelStorage")
local vm = foldervm:WaitForChild("v_Fireball")
local cy = game.Workspace.Camera:WaitForChild("CylinderSegment")

local function onEquipped(mouse)
	wait(3)
	tool:Destroy()
	vm:Destroy()
	cy:Destroy()
end

tool.Equipped:Connect(onEquipped)

Bro you’d don’t provide any code, how is people supposed to help you if you don’t give the source of the problem? Sorry if it sounded rude, I didn’t want to be

local tool = script.Parent
local foldervm = game.Workspace.Camera:WaitForChild("ViewmodelStorage")
local vm = foldervm:WaitForChild("v_Fireball")
local cy = game.Workspace.Camera:WaitForChild("CylinderSegment")

local function onEquipped(mouse)
	wait(3)
	tool:Destroy()
	vm:Destroy()
	cy:Destroy()
end

tool.Equipped:Connect(onEquipped)

i already edited the post sorry if i didnt reply in 5 days i didnt check