Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tool won't properly load when bought from shop GUI?

Asked by 4 years ago

this is a re-ask since it hasn't been answered when i first posted it weeks ago.

so i created a shop GUI for my tools (which each contain a handle and multiple parts). yes the tools are welded, so that isn't the problem.

I can't figure out what the problem is, whether it's the tool's issue or whether it's the shop's issue.

When the item is bought from the store, it only gives the handle, and nothing else. Scripts that go along with the handle also do not function properly (they don't increase the specified stat when activated.)

This is the script being used for buying the item via the GUI:

local player = game.Players.LocalPlayer
local stats = player:findFirstChild("leaderstats")
    local sp = stats:findFirstChild("Cronches")
    function onClicked()

      if sp == nil then return false end
            if (sp.Value >= 40) then
            sp.Value = sp.Value - 40
            print("Enough Money")
            game.Lighting.Library.redstick:clone().Parent = player.Backpack
     end
end


script.Parent.MouseButton1Click:Connect(onClicked)

redstick is the tool being cloned, cronches is the value being used to buy the tool. I wondered if it was because it was being stored within Lighting, but that wasn't the case. If anyone could please help, that would be appreciated, thank you.

Other notes if needed to know:

The parts are welded,

All the parts are not within a folder in the tool. They are simply within the tool,

There are no errors that come up in the outcomes when testing.

Answer this question