I'm trying to do something like Jojomen did with his "Honey Madness" game. I want to detect if a player joins then print their name in the output. here's my code I can't seem to get right:
game.Players.PlayerAdded = Player:Get("Name") -- a little worried this part won't work. -- what do I put here? print(game.Players.LocalPlayer.Name..'has joined this server.')
The problem is I don't know how to get the player's name. and the
print(game.Players.LocalPlayer.Name..'has joined this server.')
probably won't work. Anyone know how to fix this?
I would put it into a function.
game.Players.PlayerAdded:connect(function(p) print(p.Name .." has joined the server!") end
Basically what Alliance said.
Game.Players.PlayerAdded:connect(function(plr) print(plr.Name.." has joined the server!") end