Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i change the local player saved speed?

Asked by 5 years ago
Edited 5 years ago

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)
0
dont post pictures, post code we can copy and paste to make it easier to help User#24403 69 — 5y
0
When posting code, make it in a code block for organization and appeal purposes. This code hurts to look at. IdealistDeveloper 234 — 5y
0
idk how to do that, im new to this site Gameplayer365247v2 1055 — 5y
0
wrong script, you need to ues remote events when dealing with local and regular script data transfers greatneil80 2647 — 5y
0
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 Gameplayer365247v2 1055 — 5y

Answer this question