(TL:DR i made a leaderboard but i cant get a item to add 1+ to weight.) i am new to roblox studio and i have made a leaderboard script:
local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("GemSaveSystem")
local ds2 = datastore:GetDataStore("WeightSaveSystem")
game.Players.PlayerAdded:Connect(function(plr)
local folder = Instance.new("Folder", plr)
folder.Name = "leaderstats"
local gems =Instance.new("IntValue", folder)
gems.Name = "Gems"
local weight = Instance.new("IntValue", folder)
weight.Name = "Weight"
gems.Value = ds1:GetAsync(plr.UserId) or 0
ds1:SetAsync(plr.UserId, gems.Value)
weight.Value = ds2:GetAsync(plr.UserId) or 0
ds2:SetAsync(plr.UserId, weight.Value)
gems.Changed:connnect(function()
ds1:SetAsync(plr.UserId, gems.Value)
end)
weight.Changed:connect(function()
ds2:SetAsync(plr.UserId, weight.Value)
end)
end)
But i cant get a item to add 1+ to weight.Value, and cant get it to detect a click.

3 comments
https://forum.scriptinghelpers.org/topic/911/how-to-format-questions-answers-on-the-main-site-2
regular script, for click detector use MouseClick or use magnitude from pos to other pos. to increment something use weight.Value = weight.Value + 1 from regular script
Is it like a gear u want to add weight or a button?