Help with making a wave system/Solving a issue

I want to create a wave and enemy counter system. There was an issue.

I tried to create a wave system and an enemy counter system, I tested it and the script isn’t working. The dev console said this:
Screen Shot 2022-09-13 at 20.36.12
(it was a private/test game so don’t bother other free models)

I tried to find the solution but I can’t

Code for the UI Script:

local WaveValue = script.Parent.Parent.WaveValue
local CounterValue = script.Parent.Parent.CounterValue

local WaveUI = script.Parent.Wave
local EnemiesRemainingUI = script.Parent.EnemiesRemaining

WaveValue.Changed:Connect(function()
	WaveUI.Text = WaveValue.Value
end)

CounterValue.Changed:Connect(function()
	EnemiesRemainingUI.Text = CounterValue.Value
end)

Second Code that only to resists the first code:

local SSSCV = game.ServerScriptService.DreamManhuntModule.ModuleComponents.CounterValue
local SSSWV = game.ServerScriptService.DreamManhuntModule.ModuleComponents.WaveValue

while true do
	script.Parent.CounterValue.Value = SSSCV.Value
	script.Parent.WaveValue.Value = SSSWV.Value
	wait(0.05)
end

The first code’s location is on the ScreenGui, it is a local script. The second code is on the StarterGui which is a normal script

If have found the solution:
I moves the second code to ServerScriptService and I added the both values to the workspace. I also change the first code a bit.

Youtube could help. helped me in alot of things.

I already solved this by just putting my values on workspace and change the location of scripts and I forgot how to close the topic.