#How to Toggle UI by using a checkbox
39 messages · Page 1 of 1 (latest)
You need to put this script in a textbutton,not an image button or image label
@sterile vessel we gotta stop tryna answer the same questions 😂
Lol
Im not stupid, ofc i did it in a local script inside of a textbutton
You said "image"
What's the objective?
A xheckbox
It's ok
Use a image label and change the checked property
Don't really remember what it's called
This is the thing I've been making, its trash ik but its a prototype so......
It's alright
All i want is that when i press the checkbox, the guide will disappear
Do what I said
Create a variable for "checked"
Boolean
And if it's true make the GUI disappear
That should be the easiest way, perhaps paulogarithm knows another solution
Yea i did... Well atleast thats what chatgpt told me. 
But its false though
In the text button
local checked = false
local button = script.Parent
local function OnClick()
checked = not checked
button.Text = if checked then "✓" else ""
end
button.MouseButton1Click:Connect(OnClick)
So i think thats the wrong?
I don't really know why chatgpt did allat
That works too
You just need that
If you have multiple, you can change the script with a for loop
Wait. This only?
Why in chatgpt its like a whole essay sheet lmao
I don't really get why he'd use a textbutton instead of a image button tho
Cause it overcomplicates stuff
Idk shit man. Don't blame me 
Yes, you can tru
Copy paste is good atleast. 
Thanks! I will try this l8r. Im at school rn polishing our project proposal. 
My version (imagebutton):
local checked = false
button.MouseButton1Click:Connect(function()
if not checked then
button.Image = rbxassetid://checkedimage
checked = true
else
rbxassetid://initialimage
end
end)
startbutton.mouseButton1Click:Connect(function()
If checked then
startergui.blahblahblah.Visible = false (you might wanna disable the screen GUI directly)
end
end)```
Apologies for any mistakes, was made rushed and on my phone
** You are now Level 2! **