#IM TRYING TO MAKE MY IMAGE LABEL APPEAR WHEN I OPEN MY PLAYER STATS BUTTON BUT ITS NOT WORKING! (RES

402 messages · Page 1 of 1 (latest)

sharp brook
#

show script

safe narwhal
#

you have a image

frosty lichen
#

Ok

#

Ye

sharp brook
#

this is roblox being annoying

#

you have to go into the playergui from the local player

frosty lichen
#

Ok

#

So

#

Local player?

#

I'm confused

sharp brook
#

do ```lua
local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
plrGui.PlayerStats.Open.Visible = not plrGui.PlayerStats.Open.Visible
end)

frosty lichen
#

Ok

sharp brook
#

this should work i think

frosty lichen
#

Ok

#

Lemme try it

sharp brook
#

im not quite sure what you are trying to make visible though

#

so i think it wont work as you expected

frosty lichen
#

I'm trying to make a image label visible

#

A image label with the asset of a star

sharp brook
#

ok so instead of doing ```lua
plrGui.PlayerStat.Open
--Just do
plrGui.(theRootToTheThingYouWantToMakeVisible)

frosty lichen
#

Ok

lofty treeBOT
#

studio** You are now Level 5! **studio

frosty lichen
#

WIt

#

Wait*

#

What's the root of the thing I want to make visible?

sharp brook
#

where ever it is located

frosty lichen
#

So I chang3 line 5

sharp brook
#

yes to whatever is turning invisible

frosty lichen
#

Plrgui.

#

Ok

#

So in this case that would be the image label

sharp brook
#

yes

frosty lichen
#

Umm

#

I don't think I did this right...

sharp brook
#

show me

frosty lichen
sharp brook
#

i didnt mean literally just putting the name of the thing

frosty lichen
#

Sorry bro

#

I'm still learning how to code

sharp brook
#

do you understand what parents and children are?

frosty lichen
#

Kind

#

Kinda

sharp brook
#

plrGui is referring to startergui

#

can you show me the thing you want to make visible in the explorer

frosty lichen
#

Ok

#

Yes

sharp brook
#

:/

#

show me where it is in the explorer

frosty lichen
#

Oh

sharp brook
#

wait actually i think ik where it is

frosty lichen
sharp brook
#

ok you have to do ```lua
plrGui.PlayerStats.Open.imageLabel -- the root of the image

#

thats the root

frosty lichen
sharp brook
#

so you gotta do ```lua
local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
plrGui.PlayerStats.Open.imageLabel.Visible = not plrGui.PlayerStats.Open.imageLabel.Visible
end)

frosty lichen
#

Ok

#

I got it

#

One more question before I test it

sharp brook
#

test it first

frosty lichen
#

Ok

#

It's weird

#

When I open my player stats

#

The star disapears

#

I think I know why tho

#

Do I set the image label as true or false in visible in the properties?

sharp brook
#
local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
  plrGui.PlayerStats.Open.imageLabel.Visible = true
end)
#

try this instead

frosty lichen
#

Do I set the image label as true or false in visible in the properties?

sharp brook
#

it depends on if you want it to start of as invisible or visible

frosty lichen
#

Invisible

#

Until u open ur playerstats

#

To make it visible

#

Hey

#

@sharp brook

#

I tested it

#

It worked

#

Kinda

#

The thing is when I close the player stats I want the image label to the unvisible

#

So how do I do that?

sharp brook
#

so its like a toggle then?

frosty lichen
#

Yes

#

Ig

#

Yes it is

sharp brook
#

so if it is visible and you click it will turn invisible and vice versa?

frosty lichen
#

Yes

sharp brook
#
local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
  plrGui.PlayerStats.Open.imageLabel.Visible = not plrGui.PlayerStats.Open.imageLabel.Visible
end)
#

the first one was correct then

#

this will just set the visibility to whatever it isnt currently

frosty lichen
#

Not opened playerstats=invisible image label
Open playerstats=visible image label
Close playerstats=invisible image label

frosty lichen
#

This is what I want

sharp brook
#

i have no idea what you mean bro im gonna be completely honest

frosty lichen
#

Ok

#

Join my roblox game

#

Nvm

#

@sharp brook

#

I'll just tell u what I want

#

When u load in the game

#

The image label shouldn't be visible

#

Until you click on the playerstats gui

#

It makes the image label visible

#

Then after you close the gui

#

It makes the image label invisible

#

Or

#

Not visible

#

So can you try to do that?

#

Pls

sharp brook
#

just use if statements

frosty lichen
#

All I want is when you close the gui the image labels visibility turns invisible

#

I don't know how to do that tho

#

Ok obviously I know if

#

But after if what do I put?

#

Like bro I don't know how to code

#

Litterly

#

I'm still learning

#

So what do I put?

#

@sharp brook

#

If...

#

Ok

#

I kinda did a if sentence

#

@sharp brook

#

Let me know if it's right

sharp brook
#

fine

frosty lichen
sharp brook
#

first you should know how to detect if ur syntax is wrong

#

the red underlinings will tell you that

#

the = before false should be ==

#

and there should be a "then" after false

frosty lichen
#

?

#

Is this it?

#

Is that all I put?

#

@sharp brook

#

Hey man

#

I need your help bro

#

@sharp brook

#

I can't do this alone

safe narwhal
#

and put plrGui.PlayerStats.Open.imagelabel.Visible = true
into if plrGui.PlayerStats.Open.imagelabel.Visible == false then

frosty lichen
#

Ok

#

@safe narwhal

lofty treeBOT
#

studio** You are now Level 6! **studio

frosty lichen
#

Can you give me a little better description?

safe narwhal
#

y

#

so

frosty lichen
#

I don't understand that's y

safe narwhal
#

yes

frosty lichen
#

So tell me what I add

#

Or change

#

And the lines so I know where to add or change it

safe narwhal
#

local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
local ui = plrGui.PlayerStats.Open.imagelabel
if ui.Visible == false then
ui.Visible = true
ui.Active = true
end
end)

#

and

#

check on Open button properties, Close button properties, imagelabel properties the Active option has is enabled or no

#

if not enabled then enable

frosty lichen
#

Ok

#

So

#

I got the script

#

Now what I understand is

#

I enable the active option for:
-open button
-close button
-image label

safe narwhal
#

yes

frosty lichen
#

The thing is

#

I don't have a close button

safe narwhal
#

its is disabled?

frosty lichen
#

I have a open button

safe narwhal
#

then open and imagelabel

frosty lichen
#

Ok

#

Then

#

The parent is the open button right

#

?

safe narwhal
#

?

frosty lichen
#

The open button is the parent of the image label and the script right?

safe narwhal
#

click to Open

frosty lichen
#

Ok

#

@safe narwhal

#

One last question

safe narwhal
#

You see Active option?

lofty treeBOT
#

studio** You are now Level 5! **studio

frosty lichen
safe narwhal
#

k

frosty lichen
#

I enabled active option on the open button and the image label

safe narwhal
#

this bug happened to me

frosty lichen
#

Ok

#

Now

#

I have a question

#

Before I test the game

safe narwhal
#

how i remember its is working in the roblox

#

k

frosty lichen
#

What do I put for the image labels visibility in the properties tab?

safe narwhal
#

nothing

frosty lichen
#

So I leave it blank

#

I don't check it

safe narwhal
#

wait u mean visible?

frosty lichen
#

Yes

safe narwhal
#

uh

#

one sec

frosty lichen
#

On the image label

#

Ok

safe narwhal
#

in the local script

#

paste this

local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui

script.Parent.MouseButton1Click:Connect(function()
local ui = plrGui.PlayerStats.Open.imagelabel
ui.Visible = not ui.Visible
end)
frosty lichen
#

Wait

#

So i delete the original text in the script?

safe narwhal
#

ye

frosty lichen
#

So

frosty lichen
safe narwhal
#

wiaititit

#

2io u inroe

safe narwhal
#

stop

#

wait

#

ugyno

frosty lichen
#

Ok

safe narwhal
#

no

#

but

#

change elseif to else

#

NO

frosty lichen
#

Ok

safe narwhal
#

wait

#

ima wrong

#

test

#

it

frosty lichen
#

I did

#

Didn't work

#

When I closed the gui the image label remained visible

safe narwhal
#

dk

frosty lichen
#

I want it so when I close the gui the image label goes invisible

#

Plus I also want when you open the gui the star goes visible

frosty lichen
safe narwhal
#

idk

frosty lichen
#

This part worked

#

Now we have to make a command when we close the gui/player stats the image label goes invisible

#

Then if u open the gui/player stats it's visible

#

OPEN: IMAGE LABEL=VISIBLE
CLOSE: IMAGE LABEL=INVISIBLE

#

@safe narwhal

#

that's what I want

safe narwhal
#

k

#

then

frosty lichen
#

Yeah?

#

Then what?

safe narwhal
#

change local frame = script.parent.Parent.Frame to
local frame = script.Parent.imagelabel

frosty lichen
#

Ok

#

Like this then?

safe narwhal
#

and test

#

yes

frosty lichen
#

Ok

safe narwhal
#

now test

frosty lichen
#

Bro

#

Now i can't even open my player stats

#

@safe narwhal

#

@safe narwhal

#

Let's do this

#

Join my roblox game so I can show u what I mean

#

It's called Stellar Crusader

safe narwhal
#

y

frosty lichen
#
Roblox

Check out Stellar🌟Crusader. It’s one of the millions of unique, user-generated 3D experiences created on Roblox. (UPDATE 2 IS OUT!)👾
-New Obby👍
-New Background✨
-New Mechanics 🔧
-New Graphics💎
-New spawn area ⭐
-New lobby (BIGGER LOBBIES)🏠
-New Running Animation🏃
-Better Graphics🔭
-Working Health bar!🧡
-NEW LOADING SCREEN!🎬
-LEADERBOARD?? 📈...

safe narwhal
#

then change it to local frame = script.Parent.Parent.Frame

frosty lichen
#

So you can see what I mean

safe narwhal
#

i can later srry

frosty lichen
#

Ok

safe narwhal
#

so

frosty lichen
#

Ok

#

Now it works again

safe narwhal
#

connect elseif with frame.Visible == true then

#

in your game played anyone?

frosty lichen
#

Has anyone played my game before?

#

Is that what you meant to say??

safe narwhal
#

ye

frosty lichen
#

Ye my friends

#

@safe narwhal

safe narwhal
#

352 visits

frosty lichen
#

Like this?

safe narwhal
#

cool

frosty lichen
frosty lichen
#

Do i leave line 5?

#

Or do I delete it?

safe narwhal
#

if you want delete = delete

#

its is dont change anything

frosty lichen
#

Ok, do test it now?

safe narwhal
#

ye

frosty lichen
#

Same thing...

safe narwhal
#

dk bro

#

my head is destroyed abut this

frosty lichen
#

OH WAIT

#

I think ik

#

Instead of putting frame

#

Maybe we put screengui?

#

Idk

safe narwhal
#

WAIT

frosty lichen
#

What

safe narwhal
#

you dont have screen gui?

frosty lichen
#

No

#

Wait

#

Wdym?

#

Like if I have a screengui?

#

In the explorer?

#

This is what I have rn bro

safe narwhal
#

ye u have screen gui or no

#

in explorer

frosty lichen
#

Look at playerstats

#

That's the screengui

safe narwhal
#

k

frosty lichen
#

And that's the parent of everything

safe narwhal
#

frame is Active

frosty lichen
#

Lemme check

#

No

#

It's not

#

Now it is

safe narwhal
#

test

frosty lichen
#

Ok

#

Same thing

#

Didn't work

lofty treeBOT
#

studio** You are now Level 7! **studio

frosty lichen
#

I wonder what the problem is

#

@safe narwhal

#

any more ideas?

safe narwhal
#

no

glass mesa
# frosty lichen
local frame = script.Parent.Parent.Frame

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Enabled = true --check if playerstats is even open
    frame.Visible = not frame.Visible --toggles the visibility
end)

@frosty lichen

#

checking if its visible or not is unnecessary and messy code. just make it debounce

#

if you want to make it do something when its visible do this

if frame.Visible then
    --code
end
#

if this still doesn't work, this is a problem with your gui, not the code

#

always want to make sure the zindex is on top of everything

frosty lichen
#

Ok

#

@glass mesa

#

I'm going to test it

glass mesa
#

Okay, you don't have to ping me

frosty lichen
#

Sorry

#

I just wanted to get your attention

glass mesa
#

I'm here

frosty lichen
#

Because not all people have their notis on

glass mesa
#

It does say I'm online

#

I don't use Do Not Disturb

frosty lichen
#

Okay bro

#

I'm sorry

#

Anyways

#

I didn't work

#

I mean

#

It did

#

It's just when I close my playerstats/gui the image label's still there

#

And I want the image label to go invisible when I close the player stats gui

glass mesa
#

That's because you're not toggling the visibility of the image labels too.

frosty lichen
#

Yeah

#

So how do I toggle the visibility of the image label?

glass mesa
#

It's the exact same thing.

#

ImageLabel.Visible = true

frosty lichen
#

Ok

#

So in line 3

#

I mean 4

#

Instead of that

frosty lichen
glass mesa
#

it was an example.

frosty lichen
#

Ok

#

So can you please

#

Tell me where to put the imagelabel.visible =true?

#

Like what line

glass mesa
#

Question

#

Do you have any experience with coding?

frosty lichen
#

I started coding 3 weeks ago

#

I'm still learning

#

So can you help me or not bro?

#

That's why I made this post in the first place

glass mesa
#

Usually, you don't ask for help like that. But I'm here to help.

#
local frame = script.Parent.Parent.Frame

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Enabled = true --check if playerstats is even open
    frame.Visible = not frame.Visible --toggles the visibility
    script.Parent.Visible = frame.Visible --will turn off and on with the frame
end)
frosty lichen
#

Ok thNks

#

Hey

#

So it kinda worked

#

But the actual playerstats button disappeared

#

But the image label did disappear

glass mesa
#

Yeah, because you didn't specify what image label.

frosty lichen
#

I want the playerstats button to stay

glass mesa
#

Please show me

#

Oh

#

I see now

#

Just a sec

frosty lichen
#

Ok

glass mesa
#

Just wasn't clear to me.

#
local frame = script.Parent.Parent.Frame

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Enabled = true --check if playerstats is even open
    frame.Visible = not frame.Visible --toggles the visibility
    script.Parent.ImageLabel.Visible = frame.Visible --:)
end)
#

It should work now.

frosty lichen
#

Ok

glass mesa
#

I didn't know you wanted to change the visibility of the ImageLabel

frosty lichen
#

Oh ye

#

PLAYERSTATS OPEN= VISIBLE IMAGE LABEL
PLAYERSTATS CLOSED= INVISIBLE IMAGE LABEL

glass mesa
#

?

frosty lichen
#

That's what I meant to specify sorry I didn't add that

glass mesa
#

So does it work

frosty lichen
#

It worked! (:

#

Thanks

glass mesa
#

Great. Please mark your thread as solved.

frosty lichen
#

Ok

#

IM TRYING TO MAKE MY IMAGE LABEL APPEAR WHEN I OPEN MY PLAYER STATS BUTTON BUT ITS NOT WORKING! (RES

glass mesa
#

There's a tag called Solved