ive been trying for hours to get the leaderboard value to update as you get more and more speed but i have not succeeded what so ever (exept updating it only once when you touch the baseplate) but that wont update with the touched function i put in there so i removed it this is the code:
local DSService = game:GetService("DataStoreService"):GetDataStore("Speed")
game.Players.PlayerAdded:Connect(function(plr)
local speedy = "id-"..plr.UserId
local leaderstats = Instance.new("IntValue",plr)
local savevalue = Instance.new("IntValue")
leaderstats.Name = 'leaderstats'
savevalue.Parent = leaderstats
savevalue.Name = 'Speed'
local GetSaved = DSService:GetAsync(speedy)
if GetSaved then
savevalue.Value =
else
local NumbersForSaving = {savevalue.Value}
DSService:SetAsync(speedy,NumbersForSaving)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local speedy = "id'"..plr.UserId
local Savetable = {plr.leaderstats.Speed.Value}
DSService:SetAsync(speedy,Savetable)
end)

5 comments
dont post pictures, post code we can copy and paste to make it easier to help
When posting code, make it in a code block for organization and appeal purposes. This code hurts to look at.
idk how to do that, im new to this site
wrong script, you need to ues remote events when dealing with local and regular script data transfers
ok i never script remote events so idk how to do that, and i found this script from alvinblox on youtube and edited it a little bit, i just need it to update