I am attempting to reference the player through game.Workspace[player.Name] . It's not working, why is this?
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | print (game.Workspace [ player.Name ] .Name) -- Printing name of player in workspace. |
3 | end ) |
My username is N43FGXL and I get the error: N43FGXL is not a valid member of Workspace When I check the explorer, the model of my character is in the workspace...
You are confusing the player and the character. The character is the player's physical representation in-game. Just because the player has joined doesn't mean their physical appearance has loaded. To do what you described:
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | player.CharacterAdded:Connect( function (char) |
3 | print (char.Name) -- char is equivalent to workspace[player.Name] |
4 | end ) |
5 | end ) |
You are over complicating things. It's actually quite simple!
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | print (player.Name) |
3 | end ) |