Arguement 1 missing or nil?

Im trying this script that should put a players name into a string value along with another player into another, but its coming back on a arguement 1 missing or nil error, any help?

		if num == 1 then	
			if val.Name == "L1" then
				local map = game.Workspace.Maps:FindFirstChild("Level1")
				local p1 = map:FindFirstChild("Starting Points").PointLeft
				local p2 = map:FindFirstChild("Starting Points").PointRight
				local char = player.Character
				p2.Taken.Value = true
				print("p2 value taken")
				char:FindFirstChild("HumanoidRootPart").Position = p2.Position
				print("got char root part")
				player.PlayerGui.Main.Play1.Value = player.Name
				print("made player gui name")
				local children = game.ReplicatedStorage.Maps.L1:GetChildren()
				print("got children")
				for i = 1, #children do
					print("got child in pair")
					if children.Name ~= player.Name then
						print("got children name check")
						game.Players:FindFirstChild(children.Name).PlayerGui.Main.Play2.Value = player.name  ---- error
						game.Players:FindFirstChild(children.Name).PlayerGui.Main.Play1.Value = children.name
						player.PlayerGui.Main.Play2.Value = children.Name
						else
					end
					end

i don’t see the “player” variable in there.

Which line is even the issue?

this is just a portion of the script, the player is known

Scroll over i marked it in the script

its supposed to be player.Name not player.name
Children.Name as well

The issue is ocurring because there’s no such thing as children.Name because children is a table containing all of the objects in game.ReplicatedStorage.Maps.L1, replace any calls with children inside of the for loop to children[i] and it shall work.

https://www.lua.org/pil/4.3.5.html

You’d benefit from learning about the ipairs/pairs iterator constructor (generator) functions and the next iterator function. Further documentation regarding all three can be found here.