Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't this LocalScript work?

Asked by 9 years ago

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

Log in to vote
1
Answered by
Hero_ic 502 Moderation Voter
9 years ago

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

0
Except, when you reset, you get the message. I need it to appear once, that being when you join. User#9487 0 — 9y
0
oh hmm. Hero_ic 502 — 9y
Ad

Answer this question