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

Is it possible to a get player instance without :GetPlayerFromCharacter?

To get a player instance it's common to use :GetPlayerFromCharacter(character) but is there another way of getting it without the player touching an object?

2 answers

✓ Accepted answer

Yes. It is possible. For the GUI, the GUI's parent is the player's PlayerGui and you can use this for example. However, there's much more way to do this and not only for GUI. Hope this helped!

local player = script.Parent.Parent -- This will get a player.

-- The code

3 comments

0

uh no? you can just use game.Players.LocalPlayer

0

maybe its a server sided script

0

Yes, it is a server sided script.

You can just do like:

local PlayerName = "_____" --Name of the player you want to get

game.Players:FindFirstChild(PlayerName)
--It really works this way, trust me

1 comment

0

This also works, but it is specific.

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