I know the title didn’t explain itself, but the summary will. a lot. I might edit this thread to give you more information but I can’t do it now because I have to go somewhere.
-
What do you want to achieve? I want to achieve where one
LocalScript
handles the changes to the taskbar about time. 1 setting if the user wants the midnight system (PM & AM) toggled on/off and other is if the user wants the 24 hour time toggled on/off. (I’m developing kind of like an OS on roblox, basically like ROBLOWS by StarModelX) & the otherLocalScript
to handle the click events of these 2 settings. -
What is the issue? The issue is where both of these if statements (in 1 script) wont work. Even though, it doesn’t print the error to the output. If I remove one of the if statements, it would work for one setting but not both.
-
What solutions have you tried so far? I have tried separating them into 2 scripts, wont work. I even tried moving them both if statements in different places that I can think of, doesn’t work.
One LocalScript
handling the changes: (aka. the script I’m having problems on)
local value1 = script.Parent.Parent.Parent.Settings.Hour24
local value2 = script.Parent.Parent.Parent.Settings.MidnightSystem
script.Parent.Text = os.date("%I:%M %p")
while wait() do
if value1.Value then
if value2.Value then
script.Parent.Text = os.date("%H:%M")
value2.Value = false
end
script.Parent.Text = os.date("%H:%M")
value1.Value = true
else
if not value2.Value then
script.Parent.Text = os.date("%H:%M") .. os.date("%p")
value1.Value = true
end
script.Parent.Text = os.date("%I:%M %p")
value1.Value = false
end
end
Other LocalScript
handling the button click events: (aka. the script that I’m NOT having problems on)
local app = script.Parent
local check1 = app.MainPage.TimeSection.MidnightCheck
local usesSystem = true
local value3 = script.Parent.Parent.Parent.Parent.Settings.MidnightSystem
check1.MouseButton1Click:Connect(function()
if usesSystem then
check1.Text = ""
value3.Value = false
usesSystem = false
else
check1.Text = "X"
value3.Value = true
usesSystem = true
end
end)