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

Why isnt this sending a server message?

So, i made this script based off an AlvinBlox tutorial. It's supposed to send a server message in the chat.

The only error is "StarterGui:SetCore must be fired from a localscript", but i done that an got the same error (the localscript was in startergui btw)

Here is the code:

game.Players.PlayerAdded:Connect(function(player)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = player.Name.. " just joined the game!";
		Font = Enum.Font.Cartoon;
		Color = Color3.new(0.228031, 1, 0.0260929);
		FontSize = Enum.FontSize.Size96
	})
end)

Could someone help me out?

1 answer

✓ Accepted answer

try doing this in a script in serverscriptservice

game.Players.PlayerAdded:Connect(function(player)
	game.ReplicatedStorage.NotifyJoin:FireAllClients(player) -- make remote event in replicated storage and fire
end)

local script in starter player scripts

game.ReplicatedStorage.NotifyJoin.OnClientEvent:Connect(function(player)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
        Text = player.Name.. " just joined the game!";
        Font = Enum.Font.Cartoon;
        Color = Color3.new(0.228031, 1, 0.0260929);
        FontSize = Enum.FontSize.Size96
    })
end)

1 comment

0

Thanks a ton!

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