I'm trying to make a shop but when I try to buy things in the store this error comes
script.Parent.MouseButton1Click:connect(function() local RS = game:GetService("ReplicatedStorage") local item = RS:WaitForChild("Sword") local price = 0 -- Change Your Price Here local player = game.Players.LocalPlayer local stats = player:WaitForChild("leaderstats") if stats.Robux.Value == price then -- Change the Money to your Currency Name stats.Money.Value = stats.Money.Value - price local cloned = item:Clone() local cloned2 = item:Clone() cloned2.Parent = player.Backpack cloned.Parent = player.StarterGear end end)
in line 6