You can't get a player due to multi-threading reasons. Use callbacks instead:
Or if you already have the world object/know in which world the player is:
cRoot:Get():FindAndDoWithPlayer(PlayerName,
function(a_Player)
if (a_Player:GetName() ~= PlayerName) then
-- Callback is called for the player who matches the target playername the closest.
return false
end
-- Do stuff with the player
end
)
Or if you already have the world object/know in which world the player is:
World:DoWithPlayer(PlayerName,
function(a_Player)
-- Do stuff. No need to check username here
end
)

