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?
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)