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

How do I make the server say something when an event occurs???

Alright, so first off, I want to say I did read the wiki on > SetCore. It didn't help.

game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "Welcome to my game!"; -- Required. Has to be a string!
	Color = Color3.new(0, 1, 1); -- Cyan is (0, 255 / 255, 255 / 255). Optional, defaults to white: Color3.new(255 / 255, 255 / 255, 243 / 255)
	Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold
	FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18
})

This is what the wiki supplies for us. I tried adding a function to it. Here's an example of what I tried to do:

game.Players.PlayerAdded:connect(function()

game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "Welcome to my game!"; -- Required. Has to be a string!
	Color = Color3.new(0, 1, 1); -- Cyan is (0, 255 / 255, 255 / 255). Optional, defaults to white: Color3.new(255 / 255, 255 / 255, 243 / 255)
	Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold
	FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18
})
end

This didn't work. I wasn't sure if it would. How would I set the text to... I don't know... Actually work -.-

Also I put all of this in a > LocalScript because somone told me that > SetCore only works in a > LocalScript

An Explanation/Example would be highly appreciated.

This is the wiki page I read:

Also, I'm not necessarily asking for a script; just something to help me out.

2 comments

0

Just to explain the problem more: Nothing happens

0

This is set to fire when a player joins the server: not for when you join. If you want the message to appear when you first join, you could set up a script (maybe a localscript(?) to send you the message when you join, instead of you trying to accomplish it via PlayerAdded.

1 answer

✓ Accepted answer

Alright, you're not quite there. The wiki states This feature will only work in a LocalScript (or a ModuleScript running on the client) so it must first be in a local script, placed somewhere within the Player. My preference would be to place it in StarterGui so it loads in the player's PlayerGui. Also, SetCore is a method that doesn't need to be placed within an event for it to work. You could place the SetCore method by itself in a local script within the player.

The first script you posted will work fine, if you follow what I've just said.

2 comments

0

The first script does work. Also, it was in a local script

0

But was it in the player? Thats what you didn't answer.

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