Im Making About the Game About Stats, And One of Stats is walkspeed, All i have to do is when a Humanoid Died, The WalkSpeed Goes Back to 16, How can i prevent reseting the walkspeed on spawn?
I'd have the WalkSpeed of the player stored in a Folder or wherever you want as an IntValue with the IntValue.Name as the players name and Its Value as the desired default WalkSpeed. It gets changed when the player dies if the players walkspeed has been changed.
You can do that or use a table to store player data for each player within the script. I choose a Folder for this example since It's easier to understand.
--In a regular Script game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").WalkSpeed = game.Workspace.Folder:FindFirstChild(player.Name).Value character:WaitForChild("Humanoid").Died:Connect(function() game.Workspace.Folder:FindFirstChild(player.Name).Value = character.Humanoid.WalkSpeed end) end) end)