I will explain later, first see this local script:
local Player = game.Players.LocalPlayer
local Open = script.Parent.Open
script.Parent.MouseButton1Click:Connect(function()
if Open.Value == false then
script.Parent.Text = "2X Speed: On"
script.Parent.BackgroundTransparency = 0
Player.Character.Humanoid.WalkSpeed = 25
Open.Value = true
elseif Open.Value == true then
script.Parent.Text = "2X Speed: Off"
script.Parent.BackgroundTransparency = .5
Player.Character.Humanoid.WalkSpeed = 16
Open.Value = false
end
end)
Explaination:
Inside a textbutton, I have a boolvalue named 'Open' and a local script (the above one). The default value of the boolvalue is set to false.
Now if the player click on the textbutton, then I am going to change the walkspeed of the player.
Seems simple till now?
Now let's suppose the value of the boolvalue is set to true (because the player clicked the textbutton) and on clicking, it toggles the value between true and false. And if the value is set to true (which means that the player's walkspeed will increase to 25), and then if a player dies, the value will be set to false again. And the player (after dying), will have to select on the textbutton again to increase their 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.
Back to the question:
I don't really know how to set the value to the same value it was before dying, so players don't need to press the text button every time they die.
I don't need datastores:
Because I just want the value to save when the player dies. Not when they leave the game.
Thanks for any help

3 comments
In the properties of the ScreenGui (or Billboard or Surface) that this TextButton is housed in, disable
ResetOnSpawnBut why can't I see the value of of Bool change while playing the game? What I mean is, that if the value get's changed via that local script, why can't I see the value of the Bool in the explorer getting changed. It just remains the same although the local script acts like it is changed.
I tried you way, yes the gui still says '2X Speed: On' but it resets the walkspeed whenever the player dies. Anyway to fix that?