Index Nil while using Text Box

So, I am trying to make a button which prints someones name when he write it. But when the save button is pressed the output says finding index nil.

Script -

local framePersonalBio = ScreenGui:WaitForChild("PersonalBio")
local frameMainButton = ScreenGui:WaitForChild("Button")

local buttonMain = frameMainButton.Buy
local buttonSavePersona = framePersonalBio.Main.Button

local nameInput = framePersonalBio.Main.Name.TextBox

buttonSavePersona.MouseButton1Click:Connect(function()
	local name = nameInput.Text -- Line 23

	if string.len(name) < 3 or string.len(name) > 40 then 

		return 
	else
		print(tostring(name))
		framePersonalBio.Visible = false
		frameMainButton.Visible = true
	end

end)

The script name is ButtonsHandler, and I want to acess the TextBox from “Name” ImageLabel.
image

The issue is,
image

In all Instances, Object.Name would be considered a property which would probably why it’d result in that error

Change the ImageLabel you currently have, to something else like “PlayerName” cause I think it’s overlapping that specific property

1 Like

Yeah, havent noticed that… I really should make things tidy and clean!