Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do you save a Player's WalkSpeed?

Asked by 5 months ago

Is it possible to save a character's WalkSpeed? and is it possible to save a character's WalkSpeed with this method?

local ds = game:GetService("DataStoreService")

local speed = ds:GetDataStore("Walk")


game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local humanoid = char.Humanoid
        humanoid.WalkSpeed = speed:GetAsync(tostring(player.UserId)) or 16

            humanoid.Changed:Connect(function()
                speed:SetAsync(player.UserId, humanoid.WalkSpeed)
            end)
    end)
end)

0
theres a limit to how many times u can use :SetAsync and theres no need to do tostring(plr.userId) V3N0M_Z 90 — 5mo
0
that should work just fine, but you should use: humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function() instead of just: .Changed. additionally, make sure your CharacterAdded is running gioni01 2055 — 5mo
0
and yes, you can save integer value to datastore V3N0M_Z 90 — 5mo

Answer this question