Toggle button-How to make it stay the same way after closing the ui it's in?

Hello so I need help trying to make my toggle button ui stay as the way it was enabled

image

So the image above is the settings with the buttons that needs to be toggled to enable the settings. So I just need help on how to keep the toggle ui to stay green when it’s been pressed once until it’s pressed again to make it look grey like the picture again.

save the button’s state when its closed and when reopened set its state

but how do I do that can u please help me

It doesnt save when you exit and open it up again?

when you close the gui have a table that you save each toggle button’s state, either true or false

then when you open it loop through that table and set the correct button with its state

Yeah this would work pretty well.

local SettingsEnable = {
Low_Graphics = false,
Global_Shadows = false,
High_Graphics = false,
Depth_of_Field = false,
Sunrays = false
}

In a module script right? if it is then where should I put it

no, current script on a local script

should the layout be like that?

yeah it should be like that [][][]

1 Like