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

Why doesn't this LocalScript work?

I'm trying to make a script where a message is sent once a player enters, that works, however when I added the function, it doesn't. It doesn't throw up any errors, just doesn't run. Please help? Thanks.

function onPlayerEntered()
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
Text=("Welcome, "..game.Players.LocalPlayer.Name.."!"),
Font = Enum.Font.SourceSans;
})

end 
game.Players.PlayerAdded:connect(onPlayerEntered)

1 answer

You are using a local script because of that you can not use onPlayerEntered. The solution is to place a localscript in the starterGui itself and add.

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
Text = ("Welcome, "..game.Players.LocalPlayer.Name.."!"),
Font = Enum.Font.SourceSans; 
})
--This is all you place in the localscript in the starterGui!

hope this helped! if it did please accept (maybe upvote) and your welcome. :D ~KIHeros

2 comments

0

Except, when you reset, you get the message. I need it to appear once, that being when you join.

0

oh hmm.

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