Afk = false
local Button = script.Parent
function onClick()
print("Clicked")
Afk = not Afk
print(Afk)
end
if Afk == true then
Button.Text = "Afk is On"
print("Afk is on")
end
if Afk == false then
Button.Text = "Afk is Off"
print("Afk is off")
end
Button.MouseButton1Click:connect(onClick)
This is my code, what its supposed to do is when the Gui button is clicked is toggles the value Afk to its opposite and then prints what the current status of Afk is, and depending on what the value is it will change the text of a gui button and print whether afk is on or not, but when i click the button it shows the status and yes it does print it toggling back and forth, so i know the value is changing, but the if statements arent running. I would really appreciate if someone could help me figure out why.
######Edit: I put your code in a codeblock. It is expected that you do this yourself next time. How to format questions/answers on the main site.

3 comments
And also i am new to this website so i dont know how to make the scripts in here look like a script block.
There is the lua logo, click that and put your code in there.
OK thanks, i see it now