Value is coming threw but not changing anything

So I have this wage system for my game, which needs to be updated every two seconds so that it can display on everyone’s screen how much they will get paid / minute. Kinda like on Generic Roleplay Gaem. I got the information to come in threw events on the client side into the server but it isn’t updating the numbers, although there is no error, I even used print and it is making it threw. It only updates once, and that is when the server starts. Also for those wondering I am using a NumberValue in ServerScriptService.

Here is the code, I honestly have no clue why it is doing this so if you know please help.
Local:

local event = game.ReplicatedStorage:WaitForChild("WageChange")
local parent = script.Parent.Parent.Parent.Parent.Parent.Parent
local wage = script.Parent.Value

repeat
  wait(2)
  if parent.Team.Name == "Mayor" then
    event:FireServer(wage)
  end
until false

Server:

local remoteevent = game.ReplicatedStorage.WageChange

remoteevent.OnServerEvent:Connect(function(plr, wage)
	script.Parent.Value = wage
	print("Wage Updated!")	
end)

This use case of remote events shouldn’t be done is a huge security flaw. All user input is evil.

Are you saying I shouldn’t use remote events for this? If so do you know any other way to do this?

nah remote events are the use case for this but u shouldnt be loop firing a remote event u should be using connections to see when team or wage is changed. you should also have the server do some checks, since an exploiter can manipulate the remote events arguments to whatever they want they could easily set the wage to an extreme value like 999999999999999999

Oh ok thanks, also how would I do server checks?

Well if the mayor can set the wages at their own free will then you probably should clamp the value on the server so that it cannot go above or below a certan amount. (e.g exploiters setting the wage to -9999 and making everyone poor or setting wage to 9999 and making everyone rich)

image

I have already put a limit so it can not go below 0 and above 50, using if < or >, should I use math.clamp instead or is my way fine?

It would be more efficient to type something like
script.Parent.Value = math.clamp(wage,0,50)

Ok I will try this out, thanks for the advice!

I am still getting the problem though of when I click to change it everything will go threw but the number on the server side wont change. Any ideas why?

Where is everything located? Can I see your explorer

Everything highlighted, also the server side script is inside CurrentWage
debugging1

why is there a script inside the wage textlabel? scripts only run in workspace or SSS

Anyway here is working code w/ some basic checks added
local script

local event = game.ReplicatedStorage:WaitForChild("WageChange")
local player = game.Players.LocalPlayer
local wage = script.Parent

wage.Changed:Connect(function()
	if player.Team.Name == "Mayor" then
		event:FireServer(wage.Value)
	end
end)

script

local remoteevent = game.ReplicatedStorage.WageChange

remoteevent.OnServerEvent:Connect(function(plr, wage)
	if plr.Team.Name == "Mayor" then
		script.Parent.Value = math.clamp(wage,0,50)
	end
end)

Okay, thanks I will try this out later!