Trying to check if players textbox equals another players value

  1. If textbox is empty, or textbox value equals another characters value then don’t do it

  2. Not working, no errors.

	for i,v in pairs(game.Players:GetChildren()) do
		if v:IsA("Player") then
			if script.Parent.Parent.TextBox.Text == "" then return else

			
		


				
		
		
			if v.Character.Value.Value == script.Parent.Parent.TextBox.Text then 
				local thing = script.Parent.Parent.Error
				script.Parent.Parent.Error.Visible = true
				thing.TextColor3 = Color3.new(1, 1, 1)
				thing.Position = UDim2.new(0.193, 0,0.815, 0)
				wait(.2)
				thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
				thing.Position = UDim2.new(0.071, 0,0.815, 0)


				wait(.2)
				thing.TextColor3 = Color3.new(1, 1, 1)
				thing.Position = UDim2.new(0.193, 0,0.815, 0)

				wait(.2)
				thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
				thing.Position = UDim2.new(0.071, 0,0.815, 0)

				wait(.2)
				thing.TextColor3 = Color3.new(1, 1, 1)
				thing.Position = UDim2.new(0.193, 0,0.815, 0)

				wait(.2)
				thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
				thing.Position = UDim2.new(0.071, 0,0.815, 0)
				wait(.2)
					thing.Position = UDim2.new(0.139, 0,0.815, 0)
					else
		local plr = game.Players.LocalPlayer
		local text = plr.PlayerGui.CallsignGui.Frame.TextBox
		script.Parent.Parent:TweenPosition(UDim2.new(0.5, 0,1.247, 0))
		game.ReplicatedStorage.Callsign:FireServer(text.Text)

		script.Parent.Parent.Visible = true
			local player = game.Players.LocalPlayer
		player.PlayerGui.Radio.Frame.Frame:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
	
		player.PlayerGui.Radio.Frame.Units:TweenPosition(UDim2.new(0.014, 0,0.273, 0))
		player.PlayerGui.Radio.Frame.F911:TweenPosition(UDim2.new(0.014, 0,0.538, 0))

		player.PlayerGui.Radio.Frame.Frame.POLICE:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
		player.PlayerGui.Radio.Frame.Frame.PRIMARY:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
		player.PlayerGui.Radio.Frame.Frame.FIRE:TweenPosition(UDim2.new(0.008, 0,0.033, 0))



		end
		end
	
		end
	end
	end
)
	

Print debug it until you find the exact line where it stops returning; it could be a multitude of things.

local player = game.Players.LocalPlayer

for i, v in pairs(game.Players:GetPlayers()) do
	if v:IsA("Player") then
		
		if script.Parent.Parent.TextBox.Text == "" then
			return
		end
		
		if v.Character.Value.Value == script.Parent.Parent.TextBox.Text then 
			local thing = script.Parent.Parent.Error
			script.Parent.Parent.Error.Visible = true
			thing.TextColor3 = Color3.new(1, 1, 1)
			thing.Position = UDim2.new(0.193, 0,0.815, 0)
			wait(.2)
			thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
			thing.Position = UDim2.new(0.071, 0,0.815, 0)
			wait(.2)
			thing.TextColor3 = Color3.new(1, 1, 1)
			thing.Position = UDim2.new(0.193, 0,0.815, 0)
			wait(.2)
			thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
			thing.Position = UDim2.new(0.071, 0,0.815, 0)
			wait(.2)
			thing.TextColor3 = Color3.new(1, 1, 1)
			thing.Position = UDim2.new(0.193, 0,0.815, 0)
			wait(.2)
			thing.TextColor3 = Color3.new(0.745098, 0.505882, 0.262745)
			thing.Position = UDim2.new(0.071, 0,0.815, 0)
			wait(.2)
			thing.Position = UDim2.new(0.139, 0,0.815, 0)
		else
			local text = player.PlayerGui.CallsignGui.Frame.TextBox
			script.Parent.Parent:TweenPosition(UDim2.new(0.5, 0,1.247, 0))
			game.ReplicatedStorage.Callsign:FireServer(text.Text)
			script.Parent.Parent.Visible = true
			player.PlayerGui.Radio.Frame.Frame:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
			player.PlayerGui.Radio.Frame.Units:TweenPosition(UDim2.new(0.014, 0,0.273, 0))
			player.PlayerGui.Radio.Frame.F911:TweenPosition(UDim2.new(0.014, 0,0.538, 0))
			player.PlayerGui.Radio.Frame.Frame.POLICE:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
			player.PlayerGui.Radio.Frame.Frame.PRIMARY:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
			player.PlayerGui.Radio.Frame.Frame.FIRE:TweenPosition(UDim2.new(0.008, 0,0.033, 0))
		end
	end
end

I’ve gotten rid of the errors and some unnecessary lines, make sure the references have been correctly defined & can I see the corresponding “OnServerEvent” from the server script or is it irrelevant to the issue at hand?

You may also need to add waits for certain instances to load before attempting to manipulate them from within the script.

The OnServerEvent is the one I think you looked at before in my other forum

Also it pops up as saying the value is taken but it still tweens down.