So I'm trying to create a little thing where I can set a required amount of deaths for the opposing team to win by entering a number and clicking the button but whenever I put a number it always comes out as 0.

local CND = game:GetService("ReplicatedStorage"):WaitForChild("ChangeNeededDeaths")
local KN = game.ReplicatedStorage:WaitForChild("KillsNeeded")
local preview

CND.OnServerEvent:Connect(function(plr)
	print(plr.Name.." changed the deaths needed value.")
	local newValue = plr.PlayerGui:WaitForChild("AdminGui"):WaitForChild("SetDeathsNeeded")
	repeat wait()
		KN.Value = newValue.Text
		print("getting new value")
	until KN.Value == newValue.Text
end)