How can I delete parts my script has created?

So currently I have a local script that fires a remote when the player holds button1down, and stops firing it when the player lets go of the button1down. When the player holds button 1 down a server script spawns in parts, how would I delete these parts after the player stops holding button 1, I tried making the parts global variables but that didn’t work.
local script

tool = script.Parent

plr = script.Parent.Parent.Parent

mouse = plr:GetMouse()
script.Parent.Unequipped:Connect(function()
	equiped = false
end)
script.Parent.Equipped:Connect(function()
		equiped = true

	mouse.Button1Down:Connect(function()
		if equiped == true then
		game.Workspace.SCRIPTS.TOOLS.Frost.Roar:FireServer(true)
	mouse.Button1Up:Connect(function()
	
		game.Workspace.SCRIPTS.TOOLS.Frost.Roar:FireServer(false)
	end)
		end
	end)
end)


global script

local Players = game:GetService("Players")
local db = {}
debris = game:GetService("Debris")
Players.PlayerAdded:Connect(function(plr)
    db[plr] = true
end)
Players.PlayerRemoving:Connect(function(plr)
    db[plr] = nil
end)
script.Roar.OnServerEvent:Connect(function(plr)
	if  db[plr] == true then 
	--db[plr] = false
	char = plr.Character
	char.Humanoid.WalkSpeed = 4

	bf1 = game.ReplicatedStorage.TOOLS.blueflame.BF1:Clone()
	bf2 = game.ReplicatedStorage.TOOLS.blueflame.BF2:Clone()
	bf3 = game.ReplicatedStorage.TOOLS.blueflame.BF3:Clone()
	bf4 = game.ReplicatedStorage.TOOLS.blueflame.BF4:Clone()
	while true do  wait()
	bf1.CFrame = char.Head.CFrame * CFrame.new(0,0,-2.8)
	bf1.Parent = game.Workspace
	bf2.CFrame = bf1.CFrame * CFrame.new(0,0,-2.2)
	bf2.Parent = game.Workspace
	bf3.CFrame = bf2.CFrame * CFrame.new(0,0,-2.4)
	bf3.Parent = game.Workspace
	bf4.CFrame = bf3.CFrame * CFrame.new(0,0,-2.8)
	bf4.Parent = game.Workspace
		end
	end
end)

What you could do is localize these variables outside of the OnServerEvent block, and then when you fire the Roar event with the false parameter (for example, instead of OnServerEvent:Connect(function(plr), you would do OnServerEvent:Connect(function(plr, holding), and then check the value of holding to see whether it is true or false.) you check for that and then destroy all of the parts. Hope this helps! If you need any more explanation let me know!

This is merely an idea but when you remote is fired you could store the spawned objects into a players table. This will keep it stored till you fire the RemoteEvent again which in the event that they do fire it again the objects will be deleted along with their index in the table.

This code isn’t meant to be used but i’m sure you could use it as a stepping stone to give you a better understanding on how to handle the spawned objects:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Remote = ReplicatedStorage:WaitForChild("RemoteEvent")

local PlayerParts = {}

local function HandleRemote(Player)
	if not PlayerParts[Player] then -- If a player hasn't spawned any parts.
		local NewTable = {}
		
		for Index = 1, 10, 1 do -- just a quick example to show you how to add the parts to a table.
			local NewPart = Instance.new("Part")
			NewPart.Parent = workspace
			
			table.insert(NewTable, NewPart) -- Insert the newly generated part (or cloned object in your case) to the table.
		end
		
		PlayerParts[Player] = NewTable -- Dinners ready, time to set the table.
	else 
		for _, Part in pairs(PlayerParts[Player]) do -- Loop through the players index and delete the parts
			Part:Destroy()
		end
		
		PlayerParts[Player] = nil -- Remove the players index from the table.
	end
end

-- Also check for PlayerRemoving to remove their index in the table to prevent a memory leak.

Remote.OnServerEvent:Connect(HandleRemote)

Please do not repost topics. If you have a follow-up question or need more info, reuse your existing topic.

Closing this one in favor of the newer version of this topic: