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)