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

How to fix "Character is not a valid member of Model"?

So I was making a pet thing for a simulator game and I go to try out the pets and there is an error in the output that wasn't in the tutorial I watched.

local function equipPet(player,pet) --pet stuff

	local character = player.Character

Output says "Character is not a valid member of Model" and I click on the error and it takes me to "local character = player.Character". I have also tried workspace:FindFirstChild(player.Name) and that didn't work either. pls help my game was supposed to come out a month ago but we're being held up by this one line of code

2 comments

1

is this the script or a part from it?, if it is a part from it it would be helpfull to put the whole script or just until the part where you call the function

0

Yeah, can you please give us the entire script?

1 answer

When doing workspace:FindFirstChild(player.Name), you're actually getting the player's character model, not the player, meaning you don't need to do player.Character as this is the character.

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