#What is the best way to check if a part is part of character
1 messages · Page 1 of 1 (latest)
https://create.roblox.com/docs/reference/engine/classes/Players#GetPlayerFromCharacter
If the part's parent returns a player, it's from a character
thx 🙂
just hit play then go to explorer while your playing, select your character and see your parts by right clicking on your character and clicking expand all
if your using r6. there should be 6 parts. r15. 15 parts
I think they meant via script
oh alright
could be done in both
but imo manually is easier for me
I dont think that is what i need
When you say "character" I assume you meant the character of a player
if Players:GetPlayerFromCharacter(part.Parent) returns anything other than nil, then the part belongs to a character
will it cause error if part.parent is just a regular part?
** You are now Level 3! **
Nope. Just tested it.
print(
game:GetService("Players"):GetPlayerFromCharacter(
Instance.new("Part")
)
)
returns nil
is there a way to get the player directly?
game.players.getplayerfromcharacter(hitpart.parent) is the direct way.
unless you meant game.players.getplayerfromuserid(player.userid) or something
i got a raycast
i want a way to check is result instance is a character model
don't you mean check if the instance is a player's character?
i just want the play model
hit.parent?
but how do i check if that is the character?
with this
i'm confused