Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I access the Player in the workspace?

How do I access the Player in the workspace?

I want to be able to access the physical player in the workspace rather than the LocalPlayer in the Players section.

4 comments

0

why?

0

why not?

0

You just need to know something about the player to be able to find them e.g. name or id.

0

..... so I would have to make a library of every single player on Roblox.

2 answers

✓ Accepted answer

There is a property on Player called Character which always points to the Model in the workspace (if there is one) that belongs to the player.

Make sure you read the wiki page about .Character, though, because there are some subtleties about what Character points to when a player is in the process of re-spawning.

Note that if you ever create custom characters, you can manually set Player.Character and, if your characters are based on Humanoid, the default ROBLOX controllers will automatically be linked to it.

--Local Script
local plr = game.Players.LocalPlayer
local char = plr.Character
--char is the character

Wiki Pages

Player

Character

This discussion is preserved as it was. New answers, comments, and votes are closed.