Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Scrolling frame's visibility not changing to false?

Asked by 5 years ago
Edited 5 years ago

Hey there, I've been making my game Book of coding in ROBLOX. I've made that if you choose the correct options, the text label will change. That works fine but when the text label changes to a certain text like Total score: +5, the frame's visible property won't get unchecked.

I want it so that if the text label changes to a certain text, the frame will disappear.

Here's the local script inside the text label:

1if script.Parent.Text == "Total score: +5" then
2    script.Parent.Parent.Visible = false -- Changes the frame visibility to false..
3end
0
Im edited the answer, check it now :) Block_manvn 395 — 5y

3 answers

Log in to vote
2
Answered by 5 years ago
Edited 5 years ago

I think it better to use function Instance:GetPropertyChangedSignal(). It is a function that listen to the changing of a specific property of an instance.

1script.Parent:GetPropertyChangedSignal("Text"):Connect(function() --This will listen to the property Text of the UI
2 
3    if script.Parent.Text == "Total score: +5" then --Checking is the text is "Total score: +5" or not
4 
5        script.Parent.Parent.Visiable = false --Make the UI in-visiable
6    end
7end)

Hope this helping you :D

0
Works, thank you so much! SilentsReplacement 468 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Edit:

1script.Parent.Text.Changed:Connect(function()
2if script.Parent.Text == "Total score: +5" then
3    script.Parent.Parent.Visible = false
4end
5end)
0
I was rushed and I am quite new. PrismaticFruits 842 — 5y
0
. PrismaticFruits 842 — 5y
1
also, when the code is something simple as this, there isnt really in need of an explanation Gameplayer365247v2 1055 — 5y
Log in to vote
0
Answered by 5 years ago
1script.Parent.Changed:Connect(function()
2    if script.Parent.Text == "Total score: +5" then
3        script.Parent.Parent.Visible = false
4    end
5end)
0
Whenever someone clicks a text button, the text label does change but this script won't work. I want this script to wait and check if the text is changed but it only works when the text is already set when the game starts! SilentsReplacement 468 — 5y
0
thats not how it works Gameplayer365247v2 1055 — 5y

Answer this question