There's a value inside the ReplicatedStorage. I want to do a statement in order to get the value if it has loaded or not. But I want to ask if is it necessary or not? Here is the script:
local storage = game:GetService('ReplicatedStorage')
local annstring = nil
if not storage:FindFirstChild('AnnoucementString') then
annstring = storage:WaitForChild('AnnoucementString')
else
annstring = storage.AnnoucementSring
end
If it's not really necessary. Can I use this one instead? I'm just afraid of getting infinite yield.
local storage = game:GetService('ReplicatedStorage')
local annstring = storage:WaitForChild('AnnoucementString')
Edit: If neither of my methods are incorrect or not efficient then is there any better suggestion to load the value?

4 comments
Thank you for answering. But what I want is to wait for the game to load successfully before encountering any other lines of codes.
Then just leave the second parameter blank and it will wait forever until it finds that child.
Actually... That's not really how the :WaitForChild() works. If the second parameter is blank and the child doesn't appear within 10 seconds. The whole script will automatically stop the waiting yield and keeps going on without loading the value if child appears 10+ seconds late.
The WaitForChild() alone should be fine. If it times out there;s likely an error, no child, or your computer is a potato.