I want to make shop script and i test it and this error show me "cash is not a valid member of "Folder i put the codes
game.Players.PlayerAdded:Connect(function(player)
local leaderstats= Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local cash= Instance.new("NumberValue")
cash.Name="cash"
cash.Value = 1000000
cash.Parent=leaderstats
end)
this name is leaderstats and another
game.ReplicatedStorage.Toolevents.Akevent.OnServerEvent:Connect(function(player)
if player.leaderstats.cash.Value >= 5000 then
player.leaderstats.cash.Value = player.leaderstats.cash.Vaule - 5000
game.ServerStorage.Tools.Ak.Clone().Parent = player.Backpack
end
end)
is this is named Buytools pls help me

4 comments
ok
idk how i can put in black but here
I put a better version of how to do it...