well i made a leaderboard that works adn i made so u can click on the cookie but it does not give me money plz help
how do i make so i can eat a cookie and it will then give me money?
2 answers
Easy peasy!
Add a part, call it "Handle". Also make a Tool, call it "Cookie" if you'd like.
script.Parent.Activated:Connect(function(player)
game.Players[player.Name].LB.cash = game.Players[player.Name].LB.cash + 10
end
1 comment
cashData = game:GetService("DataStoreService"):GetDataStore("cashData3825") cookieData = game:GetService("DataStoreService"):GetDataStore("cookieData5936") game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("IntValue", plr) leaderstats.Name = "leaderstats" local ca = Instance.new("IntValue", LB) ca.Name = "Money" ca.Value = cashData:GetAsync(plr.userI
cashData = game:GetService("DataStoreService"):GetDataStore("cashData3825")
cookieData = game:GetService("DataStoreService"):GetDataStore("cookieData5936")
game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("IntValue", plr)
leaderstats.Name = "leaderstats"
local ca = Instance.new("IntValue", LB) ca.Name = "Money" ca.Value = cashData:GetAsync(plr.userId) or 0
local c = Instance.new("IntValue", LB) c.Name = "Cookies Eaten" c.Value = cookieData:GetAsync(plr.userId) or 0
leaderstats.Parent = plr ca.Parent = leaderstats c.Parent = leaderstats end)
game.Players.PlayerRemoving:Connect(function(plr)
cashData:SetAsync(plr.userId, plr.leaderstats.cash.Value) cookieData:SetAsync(plr.userId, plr.leaderstats.cookie.Value)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
You need to add your script that is showing an error if you're asking a question.
I'm going to answer this
here is the script for the clicker script.Parent.MouseButton1Cick:Connect(function() workspace.events.addmoney:FireServer(1) end)