You Aren’t yielding per iteration causing the loop to crash the game and break
no other code appears to be running
Therefore the text will only update once, as you aren’t telling it to update, if that if statement is supposed to indicate something, it will only run once, so use a .Changed Event for this instead of a while loop as it is generally more efficient and takes less resources to accomplish.
Another Method for formatting text can be with string.format()
format = string.format
script.Parent.Text = format("Temp : %d °C", newValue) -- updates First outside
TempRecord.Changed:Connect(function(newValue) -- Updates when there is a Change
script.Parent.Text = format("Temp : %d °C", newValue) -- basically formats the string
The issue is that the text is only setting once. Nothing is telling the script to continue reading that temperature value. If you uncommented the while loop, the game will crash because there’s no yield in the loop. What @xGOA7x suggested is the most efficient and practical, I would go with that.