#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)
you have a image
this is roblox being annoying
you have to go into the playergui from the local player
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)
Ok
this should work i think
im not quite sure what you are trying to make visible though
so i think it wont work as you expected
ok so instead of doing ```lua
plrGui.PlayerStat.Open
--Just do
plrGui.(theRootToTheThingYouWantToMakeVisible)
Ok
** You are now Level 5! **
where ever it is located
Into this?
yes to whatever is turning invisible
yes
show me
i didnt mean literally just putting the name of the thing
do you understand what parents and children are?
plrGui is referring to startergui
can you show me the thing you want to make visible in the explorer
Oh
wait actually i think ik where it is
ok you have to do ```lua
plrGui.PlayerStats.Open.imageLabel -- the root of the image
thats the root
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)
test it first
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?
local plr = game.Players.LocalPlayer
local plrGui = plr.PlayerGui
script.Parent.MouseButton1Click:Connect(function()
plrGui.PlayerStats.Open.imageLabel.Visible = true
end)
try this instead
Do I set the image label as true or false in visible in the properties?
it depends on if you want it to start of as invisible or visible
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?
so its like a toggle then?
so if it is visible and you click it will turn invisible and vice versa?
Yes
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
Not opened playerstats=invisible image label
Open playerstats=visible image label
Close playerstats=invisible image label
@sharp brook
This is what I want
i have no idea what you mean bro im gonna be completely honest
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
just use if statements
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
fine
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
?
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
and put plrGui.PlayerStats.Open.imagelabel.Visible = true
into if plrGui.PlayerStats.Open.imagelabel.Visible == false then
** You are now Level 6! **
Can you give me a little better description?
yes
This is my script so far
So tell me what I add
Or change
And the lines so I know where to add or change it
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
Ok
So
I got the script
Now what I understand is
I enable the active option for:
-open button
-close button
-image label
yes
its is disabled?
I have a open button
then open and imagelabel
?
The open button is the parent of the image label and the script right?
click to Open
You see Active option?
** You are now Level 5! **
Yes I already enabled it on them
k
I enabled active option on the open button and the image label
this bug happened to me
What do I put for the image labels visibility in the properties tab?
nothing
wait u mean visible?
Yes
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)
ye
I delete this
And paste this:
Ok
Ok
dk
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
Which is what we have so far
idk
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
change local frame = script.parent.Parent.Frame to
local frame = script.Parent.imagelabel
Ok
now test
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
y
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?? 📈...
then change it to local frame = script.Parent.Parent.Frame
So you can see what I mean
i can later srry
Ok
so
What?
Has anyone played my game before?
Is that what you meant to say??
ye
352 visits
Like this?
cool
Ok, do test it now?
ye
Same thing...
WAIT
What
you dont have screen gui?
No
Wait
Wdym?
Like if I have a screengui?
In the explorer?
This is what I have rn bro
k
And that's the parent of everything
frame is Active
test
** You are now Level 7! **
no
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
Okay, you don't have to ping me
I'm here
Because not all people have their notis on
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
That's because you're not toggling the visibility of the image labels too.
I put this?
it was an example.
Ok
So can you please
Tell me where to put the imagelabel.visible =true?
Like what line
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
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)
Ok thNks
Hey
So it kinda worked
But the actual playerstats button disappeared
But the image label did disappear
Yeah, because you didn't specify what image label.
I want the playerstats button to stay
Ok
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.
Ok
I didn't know you wanted to change the visibility of the ImageLabel
Oh ye
PLAYERSTATS OPEN= VISIBLE IMAGE LABEL
PLAYERSTATS CLOSED= INVISIBLE IMAGE LABEL
?
That's what I meant to specify sorry I didn't add that
So does it work
Great. Please mark your thread as solved.
Ok
IM TRYING TO MAKE MY IMAGE LABEL APPEAR WHEN I OPEN MY PLAYER STATS BUTTON BUT ITS NOT WORKING! (RES
There's a tag called Solved