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

Why does this chat message script not work in a server but works in studio mode?

This is my script, it works in studio but doesn't work in studio. Please help.


function Join(plr)

game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "[SERVER] :: "..plr.Name.." Joined the server!";
Color = Color3.fromRGB(220, 180, 58); 
Font = Enum.Font.ArialBold;
FontSize = Enum.FontSize.Size18;
})
end
game.Players.PlayerAdded:connect(Join)

function Leave(plr)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "[SERVER] :: "..plr.Name.." Left the server!";
Color = Color3.fromRGB(220, 180, 58); 
Font = Enum.Font.ArialBold;
FontSize = Enum.FontSize.Size18;
})
end
game.Players.PlayerRemoving:connect(Leave)

2 answers

I saw you commented that it was a server script in workspace. Try moving the script to ServerScriptService - depending on where a script is it might not execute.

1 comment

0

I will try this, I will tell reply if it works.

is it a global script? and is there a function called leave

2 comments

0

Its a global script, in workspace. Function called leave is line 12

0

If you're not posting an explanation use comments.

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