Help with Mesh tool

when I buy the second boombox i shoul have the tool correctly but the boombox mesh don’t match , I want to make when you buy the second tool automatically removed the tool and mesh of the first boombox, because when I buy another boombox tool is deleted but the mesh is not removed.

I don’t know if this is understandable

hela nhd unknown

Script

local OldtoolName = "1# Feathers Texture BB"
local ReplaceTool = "2# Gold Texture BB"
local ClickDetector = script.Parent
local Price = 5700
local Lighting = game:GetService("Lighting")
local Tool = Lighting:WaitForChild(ReplaceTool)
local DB = false
ClickDetector.MouseClick:Connect(function(plr)
      if plr.leaderstats.Cash.Value >= Price and not plr.Backpack:FindFirstChild(ReplaceTool) and not DB then
            DB = true
            if plr.Backpack:FindFirstChild(OldtoolName) then plr.Backpack[OldtoolName]:Destroy() end
            Tool:Clone().Parent = plr.Backpack
            plr.leaderstats.Cash.Value -= Price
            wait(2)
            DB = false; -- ignore any warnings saying global DB is only used in the enclosing function
      end
end)
1 Like

Check in the Plr.Character for Mesh. and just destroy it there

local mesh= plr.Character:findFirstChild(“MeshNameHere”)
If mesh then
mesh:Destroy()
end

1 Like

Bruh I answered this for you but ok
First, put the gold mesh in the tool, and name it mesh. Not in the handle, in the Tool named 2# Gold Texture BB.
Then put this script in the cd.

local OldtoolName = "1# Feathers Texture BB"
local ReplaceTool = "2# Gold Texture BB"
local ClickDetector = script.Parent
local Price = 5700
local Lighting = game:GetService("Lighting")
local Tool = Lighting:WaitForChild(ReplaceTool)
local DB = false
local Mesh = Tool:WaitForChild("Mesh") -- make sure it is named mesh
ClickDetector.MouseClick:Connect(function(plr)
      if plr.leaderstats.Cash.Value >= Price and not plr.Backpack:FindFirstChild(ReplaceTool) and not DB then
            DB = true
            if plr.Backpack:FindFirstChild(OldtoolName) then plr.Backpack[OldtoolName]:Destroy() end
            Tool:Clone().Parent = plr.Backpack
            plr.leaderstats.Cash.Value -= Price
             if plr.Character:FindFirstChild("RadioC") then plr.Character.RadioC.back.Mesh:Destroy(); mesh:Clone().Parent = plr.Character.RadioC.back end
            wait(2)
            DB = false; -- ignore any warnings saying global DB is only used in the enclosing function
      end
end)
1 Like

if i put the mesh inside tool it should be like this?

I’m going to assume you have events running when you click the buttons, either a remote event or a function, if not skip over this.

If you have the function running, you can check the players backpack for it and if it’s found use :Delete()

1 Like