#How to Toggle UI by using a checkbox

39 messages · Page 1 of 1 (latest)

flat harborBOT
#

studio** You are now Level 2! **studio

sterile vessel
#

You need to put this script in a textbutton,not an image button or image label

nocturne sonnet
#

@sterile vessel we gotta stop tryna answer the same questions 😂

sterile vessel
#

Lol

sleek mulch
sterile vessel
#

You said "image"

nocturne sonnet
#

What's the objective?

sterile vessel
#

A xheckbox

sleek mulch
#

Mb mb

sterile vessel
#

It's ok

nocturne sonnet
#

Use a image label and change the checked property

#

Don't really remember what it's called

sleek mulch
#

This is the thing I've been making, its trash ik but its a prototype so......

nocturne sonnet
#

It's alright

sleek mulch
#

All i want is that when i press the checkbox, the guide will disappear

nocturne sonnet
#

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

sleek mulch
#

Yea i did... Well atleast thats what chatgpt told me. a_melissa

sleek mulch
sterile vessel
sleek mulch
#

So i think thats the wrong?

nocturne sonnet
#

I don't really know why chatgpt did allat

sterile vessel
#

If you have multiple, you can change the script with a for loop

sleek mulch
#

Why in chatgpt its like a whole essay sheet lmao

nocturne sonnet
#

I don't really get why he'd use a textbutton instead of a image button tho

nocturne sonnet
sleek mulch
sterile vessel
sleek mulch
sleek mulch
nocturne sonnet
#

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