Random Errors [HELP!]

So my issue is that randomly scripts wont work that did work before. For example this code here:

local plr = game.Players.LocalPlayer
local clickboosttime = plr:WaitForChild("Boosts"):FindFirstChild("Gem Boost Time")

local function ToHMS(s)
  return ("%02i:%02i:%02i"):format(s/60^2,s/60%60,s%60)
end

while wait(.5) do
	if clickboosttime.Value > 0 then
		script.Parent.Visible = true
		script.Parent.Frame.TextLabel.Text = ToHMS(clickboosttime.Value)
	elseif clickboosttime.Value == 0 then
		script.Parent.Visible = false
		script.Parent.Frame.TextLabel.Text = "No Boost Active"
	end
end

Works and i just got an error saying that it cant find the value basically.

Does anyone know why this happens, another thing that was happening is sometimes dev products were not processing. Yes i do use findfirstchild etc. Does ANYBODY know a fix?

Try to use WaitForChild instead of FindFirstChild maybe
Also things run differently in studio play test, for example, localscripts run before the character/player joins(I’m pretty sure).

So your saying i should test in an actual game not in studio?

Yes, that is what I would do, try to check developer console in game also(It’s in settings) and see if any errors appear when you test

Okay thank you, i tested in game and was thrown the same error, i just changed it to waitforchild and now there is no error its just not working now lol.