Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Present Objects Errored as "Nil"?

I've been coding a message gui for a little while, and i've gotten an issue at this point. it's claiming that TEXT isn't a valid member of a TextBox. Remote code:

CreateMessage = function(text, color, font, size)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = text;
	Color = color;
	Font = font;
	FontSize = size;
	})
end
script.Parent.RemoteEvent.OnServerEvent:Connect(function(route1)
	CreateMessage("["..script.Parent.Name.Text.."]:"..tostring(script.Parent:FindFirstChild("TextBox").Text),Color3.fromRGB(255,255,255),"Arcade",25)
end)

Button code:

script.Parent.TextBox.FocusLost:Connect(function(enter)
	if enter then
		script.Parent.RemoteEvent:FireServer()
	end
end)

1 comment

0

What is your error exactly?

1 answer

it should have been:

CreateMessage = function(text, color, font, size)
    game.StarterGui:SetCore("ChatMakeSystemMessage", {
    Text = text;
    Color = color;
    Font = font;
    FontSize = size;
    })
end
script.Parent.RemoteEvent.OnServerEvent:Connect(function(route1)
    CreateMessage("["..script.Parent.Name,"]:"..tostring(script.Parent:WaitForChild("TextBox",100).Text),Color3.fromRGB(255,255,255),"Arcade",25)
end)

I guess? I mean. It's that simple

2 comments

0

It only sparked up more issues in the code. "Invalid value for enum Font"

0

Did it atleast remove the old errors? "Invalid value for enum Font" would be on line 5 which I don't know what's wrong with it

This discussion is preserved as it was. New answers, comments, and votes are closed.