I have a local script in a textlabel. And I have a different script that sets the textlabel to visible. I want the text to change but itβs not working.
local Label = script.Parent
while Label.Visible == true do
Label.Text = "π¬ Typing π¬"
wait(0.75)
Label.Text = "π¬ .Typing. π¬"
wait(0.75)
Label.Text = "π¬ ..Typing.. π¬"
wait(0.75)
Label.Text = "π¬ ...Typing... π¬"
wait(0.75)
end
It isnβt stopping automatically, when it becomes visible then invisible, the loop is still running. So it has two loops when it becomes visible again and then three loops going when it becomes visible again at the same time and so on.
local Label = script.Parent
local loop = false
Label:GetPropertyChangedSignal("Visible"):Connect(function()
loop = Label.Visible
if not loop then
return
end
while loop do
if not loop then break end
Label.Text = "π¬ Typing π¬"
wait(0.75)
if not loop then break end
Label.Text = "π¬ .Typing. π¬"
wait(0.75)
if not loop then break end
Label.Text = "π¬ ..Typing.. π¬"
wait(0.75)
if not loop then break end
Label.Text = "π¬ ...Typing... π¬"
wait(0.75)
if not loop then break end
end
end)
local Label = script.Parent
Label:GetPropertyChangedSignal("Visible"):Connect(function()
if Label.Visible == false then
return
end
while Label.Visible == true do
Label.Text = "π¬ Typing π¬"
wait(0.75)
Label.Text = "π¬ .Typing. π¬"
wait(0.75)
Label.Text = "π¬ ..Typing.. π¬"
wait(0.75)
Label.Text = "π¬ ...Typing... π¬"
wait(0.75)
if Label.Visible == false then
break
end
end
end)
Itβs odd since it should break when the condition is met, unless you are spamming it, which probably is whatβs going on