Havent a clue why its throwing this error, code is used twice, first function works fine but the second one doesnt
Searched everywhere for posts on this error but none of them relate to what im trying to do
not the full code but whats important to this error
local NText = CreateFrame.Name
local IText = CreateFrame.Icon
local function enterIcon() --works
IText.Text = IText.Text:gsub("%D", '');
if IText.Text ~= "" then
if not string.find(IText.Text, "rbxassetid://") then
IText.Text = "rbxassetid://"..IText.Text
end
end
end
local function enterName() --doesnt work
if NText.Text ~= "" then
if string.len(NText.Text) > 25 then
NText.Text = "25 characters maximum!"
end
end
end
IText.FocusLost:Connect(enterIcon)
NText.FocusLost:Connect(enterName) --error comes from here
local GUI = script.Parent.Parent
local Main = GUI.Main
local CreateFrame = Main.CreateFrame
local NText = CreateFrame.Name
local IText = CreateFrame.Icon
Your problem is the Name TextButton. You can’t name objects a property name of it’s parent. Name is basically a property of every single object so I’d add a few more characters like FrameName.