Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My shop is working, but the items I'm purchasing are not. How do i fix that?

I made a shop that works. It takes your money and gives you an item, but the item doesn't work. (the item works when I use it without buying in shop)

This is the code: (i got it from a youtube tutorial) Zims is my money

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(click)
	if player.leaderstats.Zims.Value >= 10 then
		player.leaderstats.Zims.Value = player.leaderstats.Zims.Value - 10
		
		game.ReplicatedStorage.Tools.Sword:Clone().Parent = player:WaitForChild("Backpack")
	end
end)

Thanks for helping!

2 comments

0

its local script?

0

yes

1 answer

✓ Accepted answer
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    if player.leaderstats.Zims.Value >= 10 then
        player.leaderstats.Zims.Value = player.leaderstats.Zims.Value - 10
        game.ServerStorage.Tools.Sword:Clone().Parent = Players.LocalPlayer.Backpack
    end
end)

try it

1 comment

0

First of all, thank you for helping. It worked once but now the sword is not appearing in the backpack at all.

This discussion is preserved as it was. New answers, comments, and votes are closed.