ServerScriptService.Script6:attempt to call a nil value

Hello everybody, I am very new to scripting, and I wanna make system messages, however, I keep getting this error. I don’t really know how to fix it, I would appreciate any help.

bc = BrickColor.new("Really red")
game.StarterGui:SetCore("ChatMakeSystemMessage,") {
	Text = "Remember to follow all rules given by Host and Co-Host.";
	Font = Enum.Font.Cartoon;
	Color = bc.Color;
	FontSize = Enum.FontSize.Size96
}

Youre setting the function incorrectly. The proper way to do this is:

local bc = BrickColor.new("Really red")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "Remember to follow all rules given by Host and Co-Host.";
	Font = Enum.Font.Cartoon;
	Color = bc.Color;
	FontSize = Enum.FontSize.Size96
})

Variables outside of a function require “local” before it.

Edit: it’s also better to just use “local” before any variable. Also don’t name a variable the same as any other.

1 Like

Thanks for help! Really appreciate it.

3 Likes