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

Is it possible to check the player from a character?

What I mean when I ask this question, I'm wondering if there is a way to check the player of a user when something happens in the character, similar to how you can use game.Players.LocalPlayer.Character to create actions within the character whenever something happens to the player.

Also sorry if this doesn't make much sense, I typed this question on mobile.

1 comment

0

game.Players:GetPlayerFromCharacter(Character)

1 answer

workspace.PlayerName:GetPlayerFromCharacter(plr)

The first paramater, "plr" is the player in players. Unhumanly used "game.Players:GetPlayerFromCharacter", which is getting a player from a player which makes no sense

19 comments

0

If you're asking to have an event happen when something changes in the character, please comment.

0

game.Players:GetPlayerFromCharacter(Character) gets the Player from the Character, not the Player from the Player. Are you feeling alright?

0

"GAME.PLAYERS" : get "PLAYER" F R O M <<< CHARACTER.

0

Do you know that a character is in the workspace?

0

You're targetting the player and trying to get the player from a character that doesn't exist. The whole idea for this is to let players target a player from a workspace character

0

im triggered

0

why would they name it that

0

yeah i get that now but this whole time i thought the function meant getting a player from a workspace character

0

That is EXACTLY what it does!

0

what

0

then why target game.Players if youre getting a workspace char

0

Do I have to draw a diagram?

0

yes

0

You are calling the function on the service "Players", which returns the Player that owns the physical Character you provided when you called the function.

0

i think i get it ;-;

0

The wiki says "Function of: Players".

0

They named it "GetPlayerFromCharacter" because it returns a Player that owns the Character you provided.

0

Ok, I just got back to check this, and wow. A long comment thread. Anyway, I'll try this and see if it works. And to answer your first question, yes, I wanted an event to happen where the game would check the player's backpack.

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