Attempt to index nil with text

Hello developers, I keep getting the same error, with this, I am sending information from a text box via a remote event to a text lable, however it keeps getting the error.

Client script;

local Y11 = script.Parent.Main.TT11
local remote11 = game.ReplicatedStorage.TimeTable.Year11TT

SLT.Y11.Rounded.Enter.MouseButton1Click:Connect(function()
	local Year11 = "Year11"
	local P111 = SLT.Y11.Rounded.P1E
	local P211 = SLT.Y11.Rounded.P2E
	local P311 = SLT.Y11.Rounded.P3E
	local P411 = SLT.Y11.Rounded.P4E
	remote11:FireServer(P111,P211,P311,P411)
end)

remote11.OnClientEvent:Connect(function(P111,P211,P311,P411)
	Y11.P1.Text = "Period 1: "..P111.Text
	Y11.P2.Text = "Period 2: "..P211.Text
	Y11.P3.Text = "Period 3: "..P311.Text
	Y11.P4.Text = "Period 4: "..P411.Text
end)

Server Script:

local remote11 = game.ReplicatedStorage.TimeTable.Year11TT

remote11.OnServerEvent:Connect(function(Player,P111,P211,P311,P411)
	remote11:FireAllClients(P111,P211,P311,P411)
end)


I have been staring at this for hours trying to figure it out, if anyone can help me please let me know!

You should send the string instead of the actual textbox because you can’t send instances through remote events.

Client Script:

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local Y11 = script.Parent.Main.TT11
local remote11 = ReplicatedStorage.TimeTable.Year11TT

--//Functions
SLT.Y11.Rounded.Enter.MouseButton1Click:Connect(function()
	local Year11 = "Year11"
	local P111 = SLT.Y11.Rounded.P1E
	local P211 = SLT.Y11.Rounded.P2E
	local P311 = SLT.Y11.Rounded.P3E
	local P411 = SLT.Y11.Rounded.P4E
	remote11:FireServer(P111.Text,P211.Text,P311.Text,P411.Text)
end)

remote11.OnClientEvent:Connect(function(P111,P211,P311,P411)
	Y11.P1.Text = "Period 1: "..P111
	Y11.P2.Text = "Period 2: "..P211
	Y11.P3.Text = "Period 3: "..P311
	Y11.P4.Text = "Period 4: "..P411
end)

Server Script:

--//Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--//Variables
local remote11 = ReplicatedStorage.TimeTable.Year11TT

--//Functions
remote11.OnServerEvent:Connect(function(Player,P111,P211,P311,P411)
	remote11:FireAllClients(P111,P211,P311,P411)
end)

I don’t see anything wrong, but maybe try this:

local remote11 = game.ReplicatedStorage.TimeTable.Year11TT

function Update(Player,P111,P211,P311,P411)
	remote11:FireAllClients(P111,P211,P311,P411)
end

remote11.OnServerEvent:Connect(Update)

You are trying to send a local object to the server and back from what I can see. You cannot do that since the objects are local. What I recommend doing, like @Katrist said, is sending the text itself and instead updating that way. That will work. Also, when making bug reports, please send the entire error as it helps track the bug better (although in this case it was easy to see).

You are right, How did I not see that, XD

Like @Katrist and @Batimius said, do this as the client script:

local Y11 = script.Parent.Main.TT11
local remote11 = game.ReplicatedStorage.TimeTable.Year11TT

SLT.Y11.Rounded.Enter.MouseButton1Click:Connect(function()
	local Year11 = "Year11"
	local P111 = SLT.Y11.Rounded.P1E.Text
	local P211 = SLT.Y11.Rounded.P2E.Text
	local P311 = SLT.Y11.Rounded.P3E.Text
	local P411 = SLT.Y11.Rounded.P4E.Text
	remote11:FireServer(P111,P211,P311,P411)
end)

remote11.OnClientEvent:Connect(function(P111,P211,P311,P411)
	Y11.P1.Text = "Period 1: "..P111
	Y11.P2.Text = "Period 2: "..P211
	Y11.P3.Text = "Period 3: "..P311
	Y11.P4.Text = "Period 4: "..P411
end)
Server Script:

local remote11 = game.ReplicatedStorage.TimeTable.Year11TT

remote11.OnServerEvent:Connect(function(Player,P111,P211,P311,P411)
	remote11:FireAllClients(P111,P211,P311,P411)
end)