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

How do i make the text line of this text label refresh from this line of code?

Asked by 7 years ago
while true do
script.Parent.Text = (game.workspace.Turntable.Selector.Disp.Frame.Playing.Text)
end=

0
the text only loads when you start the game, then stops changing as the other textlabels text changes gracefulsuperman 5 — 7y
0
This should crash studio if im not mistaken... Add a wait(0.1) into the loop to prevent studio crash. dragonkeeper467 453 — 7y
0
okay gracefulsuperman 5 — 7y

2 answers

Log in to vote
0
Answered by
Prioxis 673 Moderation Voter
7 years ago
Edited 7 years ago
local turntableText = game.Workspace.TurnTable.Selector.Disp.Frame.Playing

turntableText.Changed:connect(function()
    script.Parent.Text = turntableText.Text
end)

Also while true do loops aren't very good always use while wait(0.5) do -- or any amount of time you want to wait

0
you're lucky i cant rate you down. at least i tried to help him idiot User#12356 0 — 7y
0
All I did was correct you Prioxis 673 — 7y
0
you dont even know what text is changing User#12356 0 — 7y
0
your the one who doesn't know what text is changing read his script again and look at your script Prioxis 673 — 7y
Ad
Log in to vote
-1
Answered by 7 years ago
while true do
script.Parent.Text.Changed:connect(function () 
script.Parent.Text = (game.workspace.Turntable.Selector.Disp.Frame.Playing.Text)
end




http://wiki.roblox.com/index.php?title=API:Class/Instance/Changed

0
This answer is absolutely horrific #1 the .Changed function fires every time said object is changed, No need for it to be in a loop. #2 there's no delay in the loop so it will crash the game. #3 your checking if the textLabel's text changed which is the wrong way to do it.. check the object in the workspace for if it's value changed.. Prioxis 673 — 7y
0
also you never put end) for the function Prioxis 673 — 7y
0
all I did was correct you because your answer had lots of errors Prioxis 673 — 7y

Answer this question