local player = selectPlayer()
print(player.Name)
local Hdescription = Players:GetHumanoidDescriptionFromUserId(player.UserId)
local playchar = game.Workspace.Game:WaitForChild(player.Name,5)
print(#game.Workspace.Game:GetChildren())
print(playchar)
playchar.Parent = workspace.Lobby --error occurs here
This means that your code wasn’t able to find an instance named player.Name before the 5 seconds you have specified passed. Try removing the second argument and it should give you an infinite yield warning. That is just a warning meaning that it takes more than 5 seconds to find the instance, it won’t break the script. However if the script never continues(so you never see the prints in the console) then it’s an actual infinite yield, which explains the behaviour you’re encountering.
Why do you need to use game.Workspace.Game:WaitForChild(player.Name,5) to find the character? Can you use player.Character or player.CharacterAdded:Wait() instead?
The problem is that player.Name is a string, henceforth the player’s name does not have a parent. As what J_Angry said above, it would be more efficient to use player.Character then the method you are trying currently because player.Character would be an object within your game.
Maybe you aren’t supposed to. I haven’t seen any games changing the default character location(workspace), unless they implement some kind of custom character system.
@NyrionDev, you can move the player’s parent to a different location, because I tried it with a script in ServerScriptService and a folder in workspace, and it worked.
For OP, can you send a screenshot of your workspace? You’re code seems fine, so there could be a problem there.