Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

String value changes again when I respawn after dying. How I can save previous value? Help please!

Problem is inside a PlayerGui. When I click a button ("Tool3") a new value for a StringValue ("ToolSelected") inside a button named "Go" is given which is "Tool3" (Default Value is: "Tool1"). If I die the value again is "Tool1" instead of the previous one ("Tool3"). How i can save the previous Value so if I die when I respawn the Value is still "Tool3"

Here's the code for the button "Tool3"

ToolSelected = script.Parent.Parent.Parent.Parent.Go.ToolSelected

function click()
ToolSelected.Value =  "Tool3"
end

script.Parent.MouseButton1Down:connect(click)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.