Note: I am a beginner scripter, so I might have problems! The script I use:
function onPlayerEntered(newPlayer) wait(5) local Msg = Instance.new ("Hint") Msg.Parent = game.Workspace Msg.Text = "Welcome to my game "..player.Name.."! Thanks!" wait(5) end game.Workspace.Players.PlayerAdded:connect(onPlayerEntered)
I really need help on this one! I seem to find nothing wrong with it.
game.Players.PlayerAdded:connect(function(plr) local msg = Instance.new("Hint", game.Workspace) msg.Text = "Welcome to my game "..plr.Name.."! Thanks!" wait(3); msg:Destroy(); end)
You didn't define the player correctly and the wait(0) is pointless.
A friend suggested you don't use this though (which I agree with) since hints are outdated. Using a GUI and TextLabels is probably better.
Line 5: its not player, its newPlayer
function onPlayerEntered(newPlayer) wait(0) local Msg = Instance.new ("Hint") Msg.Parent = game.Workspace Msg.Text = "Welcome to my game "..newPlayer.Name.."! Thanks!" wait(5) end