This is an item shop script
local player = game.Players
Cash = script.Parent.Parent.Parent.Parent.Parent.RealMoney
local tool = game.Lighting.Spas12
function onClick()
if Cash.Value >= 10 then
Cash.Value = Cash.Value - 10
local clone = tool:Clone()
clone.Parent = player.Backpack
end
end
script.Parent.MouseButton1Click:connect(onClick)
the leaderboard
local rs = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(plr)
local ls = Instance.new("IntValue", plr)
ls.Name = "leaderstats"
local rc = Instance.new("NumberValue", plr)
rc.Name = "RealMoney"
local c = Instance.new("StringValue", ls)
c.Name = "Money"
c.Value = "$"..rc.Value
c.Value = 10
rc.Value = 10

13 comments
Put Spas12 in ReplicatedStorage instead of Lighting.
ok ill try
The reason is because "player" is the game.Players not the actual person who is playing
game.Players is where all the players are located, not the specific player.
What should I replace it with ?
What is script.Parent?
That line is the players money
Can I see the Leaderboard/Leaderstats script?
the problem with the orig script wasn't the cash, but the tool didn't go into the players backpack
The cash has to do with the tool going in the backpack.
Can I see thew Leaderboard/Leaderstats script?
ok
I edited my answer. Hope it works!