Cannot read the text inside of a textbox while using a localscript

I want to make something that copies a button and changes values depending on the textbox’s text but something super strange happened. The localscript cant read the text in a textbox. I made a print in the localscript but it just prints nothing.

The localscript:

local Input = script.Parent.Parent.input.Text
local Sample = script.Parent.Parent.Parent.Sample.Button
local Event = script.RemoteEvent

script.Parent.MouseButton1Click:Connect(function()
	print(Input)
	Event:FireServer(Input)
end)

The script:

local Sample = script.Parent.Parent.Parent.Sample.Button

script.Parent.LocalScript.RemoteEvent.OnServerEvent:Connect(function(Plyr, Input)
	if Input then
		local Clone = Sample:Clone()
		Clone.Name = Input
		Clone.Parent = script.Parent.Parent.Parent.ScrollingFrame
		Clone.Visible = true
		
		print(Input)
	end
end)

image

script.Parent.LocalScript.RemoteEvent.OnServerEvent:Connect(function(Plyr, Input)

The Plyr parameter does not seem to be described in the :FireServer(Input) script.

Edit: Due to more knowledge I am reading from other posts this is not the issue as the Plyr parameter does not need to be described.


1 Like

FireServer always gives the Player.

2 Likes

The player parameter isn’t needed on the localscript. But it is on the server script.

1 Like

The text isn’t being updated this might be your issue.

local Input = script.Parent.Parent.input
local Sample = script.Parent.Parent.Parent.Sample.Button
local Event = script.RemoteEvent

script.Parent.MouseButton1Click:Connect(function()
	print(Input.Text)
	Event:FireServer(Input.Text)
end)
2 Likes