I want it so that when a player dies, we should save their walk speed. And when he spawns again, we should apply the saved walk speed of the player.
I have this local script (I will explain later):
script.Parent.MouseButton1Click:Connect(function()
local Player = game.Players.LocalPlayer
local Open = script.Parent.Open
if Open.Value == false then
Open.Value = true
script.Parent.Text = "2X Speed: On"
script.Parent.BackgroundTransparency = 0
Player.Character.Humanoid.WalkSpeed = 25
elseif Open.Value == true then
Open.Value = false
script.Parent.Text = "2X Speed: Off"
script.Parent.BackgroundTransparency = .5
Player.Character.Humanoid.WalkSpeed = 16
end
end)
Inside a text button, there is the above local script and a âBoolValueâ called âOpenâ.
Whenever a player dies, their walkspeed will be set to 16, (which is the default walk speed).
Now in my game, the playerâs will continuously die, because my game is an obby. And people continuously die from lazers etc. So the players wonât like it when they will have to again and again press the textbutton every time they die just to increase their speed. Because they will die so many times.
So is there anyway to just save their walk speed when they die. And set it to the saved value?
I donât need datastores:
I just want to save their walkspeed when they die, not when they leave the game.
Maybey in a local script make a humanoid.died event and in the event save the players walkspeed in a variable then make another event called player.characterAdded and set the walkspeed to the variable you just set before.
The humanoid should still be in the character when they die, so on a death event you can save their walkspeed ads a variable then on a player.CharacterAdded:Wait() then reset the humanoids walkspeed to the variable from earlier.