UI resets after leaving (Saving Ui Posistion)

So I was creating my ui when I saw that when you choose like lets say Iq2 then after you leave the ui and come back to it reset’s back to Iq1

Here’s a video

Here is the code I’ve been using:


local StarterGui = player:WaitForChild("PlayerGui")

local UI =StarterGui:WaitForChild("MainMenu")

local Button = UI:WaitForChild("Multiplication")
local multi2 = UI:WaitForChild("mammal")
local multi1 = UI:WaitForChild("reptile")
local mleft = UI:FindFirstChild("multileft")
local mright = UI:FindFirstChild("multiright")

Button.MouseButton1Click:Connect(function()
    mleft.Visible = true
	mright.Visible = true
	multi1.Visible = true
	multi2.Visible = true
end)

The code is a basic click to appear script but I want it to also save the choice so it dosen’t reset when you exit the ui

Any help would be greatly appreicated!

Possibly, you could try to turn off [ResetOnSpawn] in the main GUI, so that when re-clicking it saves the last thing that was opened, Let me know if that solves it, if not I will look into it some more for you.

Thanks, Opex.

1 Like

Well I turned off [ResetOnSpawn] and sadly didn’t work. But still Thanks for sharing your solution!

Would you mind showing me the contents of your GUI In which these elements are in?

Thanks, Opex.

1 Like

It won’t be necessary anymore, I changed up the script a bit and now it’s working all fine. But still Thanks! :slight_smile: