Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

while true do
script.Parent.Text = (game.workspace.Turntable.Selector.Disp.Frame.Playing.Text)
end=

3 comments

0

the text only loads when you start the game, then stops changing as the other textlabels text changes

0

This should crash studio if im not mistaken... Add a wait(0.1) into the loop to prevent studio crash.

0

okay

2 answers

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

4 comments

0

you're lucky i cant rate you down. at least i tried to help him idiot

0

All I did was correct you

0

you dont even know what text is changing

0

your the one who doesn't know what text is changing read his script again and look at your script

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

3 comments

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..

0

also you never put end) for the function

0

all I did was correct you because your answer had lots of errors

This discussion is preserved as it was. New answers, comments, and votes are closed.