I'm trying to find a script where is a certain user was to join the server, there will be a pop up on the screen saying "User joined the game!"
For some reason, the script isn't working though.
I found the script on an outdated youtube video and I'm trying to get it to work, here's what I have.
function OnPlayerEntered(player) if player.userId == game.CreatorId then --for the game owner, might remove it local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = "The creator has joined the server!" wait(2) msg:remove() elseif player.Name == "Aprilsaurus" then --what I'm trying to work on local msg = Instance.new("Message") msg.Parent = game.Workspace msg.Text = "The Dev has joined this server!" --the text wait(10) msg:remove() end end game.Players.ChildAdded:connect(OnPlayerEntered)
I don't see any errors in the output so I'm not sure why it's not working, any help is appreciated.
You should be using .PlayerAdded
instead of .ChildAdded
Try this:
local Players = game:GetService("Players") local function playerAdded(Player) -- Rest of code here. end Players.PlayerAdded:Connect(playerAdded)