There is a function called GetPlayerFromCharacter(), but i want to do the opposite.
✓ ANSWER ACCEPTED
How do u get character from player?
2 answers
✓ Accepted answer
function GetCharacterFromPlayer(player)
if player.Character then
return player.Character
end
end
--This function just returns the character if there is one.
You can also do player.Character, but it's better if you check if it isn't nil.
Short answer: You can use the Character property to access the character.
newpart.Position = GetCharacterFromPlayer(script.Parent.Parent.Parent).Head.Position
If i do this, i get an error: Character is not a valid member of Workspace.
1 comment
0
The error explains itself. You're doing the function on the Workspace instead of the player.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
I got an error while trying this. Character is not a valid member of workspace.
Whats the point in checking if the character exists in your function since it returns nil if it doesn't exist, like how "player.Character" has when there is no character?
^ oh, you're right i truly messed up there