A script that automatically unlocks trails

function Initialize()
	
	game["Run Service"].RenderStepped:Connect(function()

		for _, Variable in pairs(Players:GetPlayers()) do

			local leaderstats = Variable:WaitForChild("leaderstats")

			local BestTime = leaderstats.BestTime.Value

			for _, Trails in pairs(Trails_Folder:GetChildren()) do

				if Trails:IsA("Trail") and Trails:FindFirstChild("Price") then

					if BestTime >= Trails.Price.Value then

						for _, Buttons in pairs(Trail_Purchase_UI:GetChildren()) do

							if Buttons:IsA("ImageLabel") and Buttons:FindFirstChild("TextButton") then

								local Equip = Buttons:FindFirstChild("TextButton")

								if Trails.Name == Buttons.Name then

									Equip.Visible = true

								else

									Equip.Visible = false


								end
							end
						end
					end
				end
			end
		end
	end)
	
end

There’s no errors but equip button will not display even if the player has enough.