i am new to scripting and want to make a saving leaderboard. i have already scripted an auto saving leaderboard that looks something like this.
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("MoneyStats")
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder", Player)
Leaderstats.Name = "leaderstats"
local Currency = Instance.new("IntValue", Leaderstats)
Currency.Name = "Money"
Currency.Value = 0
local Data = DataStore:GetAsync(Player.UserId)
if Data then
Currency.Value = Data
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, Player.leaderstats.Money.Value)
end)
and i want to make a UI button that adds 10 money to the leaderboard when clicked but i can't do that using local scripts so i have to use a remote to do it. but here comes the problem. I don't know how to trigger them and what terms and parameters to use

2 comments
These might be helpful: https://www.youtube.com/watch?v=wCr5VXJ34T4 or this: https://www.youtube.com/watch?v=GwhPXyYKkwU
tanks the second one was the one i was already following