Tools do not function/activate after being added from replicated storage to the backpack

Hi! I am making a shop and got most of the basic elements, a simple GUI and what not.

I have one issue that is stopping me, it is when the tool is added from a folder in replicated storage called Rockets, where the rocket launcher is located and added to the inventory.

Whenever it is added, it does not function or activate at all.

I’ve also tried it with other tools, including the ClassicSword, in which it also did activate or function.

(here is a video below)

Here is my code below, which is located in the text button.

local tool = game.ReplicatedStorage.ShopTools.Rockets:FindFirstChild("RocketLauncher")
local money = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Money")
local button = script.Parent

button.MouseButton1Click:Connect(function()
    if money.Value >= 1000 then
        money.Value -= 50 
        if tool then
            tool.Parent = game.Players.LocalPlayer.Backpack
        else
            warn("Tool not found in ShopTools")
        end
    end
end)


Try adding the tool to the player from the server.

-- Server
local PlayerBuyTool = <remote event location>

PlayerBuyTool.OnServerEvent:Connect(function(player, tool)
    local money = <money-location>
    if money.Value >= 50 then
        money.Value -= 50
        -- Add tool
    end
end)

Remote Event

When you add the tool from the Client (Local Script) the tool are added just for you.
Humanoid:EquipTool(tool) equip the tool

1 Like