Hello so, I am trying to make a game on ROBLOX, pretty simple were each second you get +1 jump power, now I got the jump power thingy up and running, but I want to do so it saves when a player leaves and joins, so far I found this code on the internet, but nothing worked, here is the code.
local DataStores = game:GetService("DataStoreService") local FirstDataStore = DataStore:GetDataStore("JumpPowerStorage")
game.Players.PlayerAdded:connect(function(player) wait(0.1) player.Character.Humanoid.JumpPower = FirstDataStore:GetAsync(player.UserId) or 0 FirstDataStore:SetAsync(player.UserId, player.Character.Humanoid.JumpPower) player.Character.Humanoid.Changed:connect(function() FirstDataStore:SetAsync(player.UserId, player.Character.Humanoid.JumpPower) end) end) game.Players.PlayerRemoving:connect(function(player) FirstDataStore:SetAsync(player.UserId, player.Character.Humanoid.JumpPower) end)
please help me fix it, thanks.

1 comment
it still doesn't save the jump power after rejoining