I used
1 | h.Visible = not h.Visible |
to make the SettingsChanger frame visible once the player clicks, if he/she clicks again it becomes invisible. However, I can't get this working properly. How can I make it so that when the player clicks it changes the text to "Close", and when he clicks again changes the text to "Settings"?
01 | local h = script.Parent.Parent.SettingsChanger |
02 | local a = script.Parent.Parent.SettingsToggle |
03 |
04 | function click() |
05 | a.Text = ( "Close" ) |
06 | h.Visible = not h.Visible |
07 |
08 |
09 | end |
10 |
11 | script.Parent.MouseButton 1 Click:Connect(click) |
Thanks FakeWhatWeDontKnow for the comment above. It wasn't working properly but I edited my script using yours and it works. Appreciate it!
01 | local h = script.Parent.Parent.SettingsChanger |
02 | local a = script.Parent.Parent.SettingsToggle |
03 |
04 | function click() |
05 | h.Visible = not h.Visible |
06 | if a.Text = = "Settings" then a.Text = "Close" |
07 | elseif a.Text = = "Close" then a.Text = "Settings" |
08 | end |
09 | end |
10 |
11 | script.Parent.MouseButton 1 Click:Connect(click) |