Part in Model always returning nil

yes. It is just not reading the fact that they are in the model. I made sure the cloned model had the spheres in them.

okay hold on. let me get more context.

So this is the ServerScript which is cloning the Hands (The script is in ServerScriptService).

as you can see, the line:

local LeftHandCloneWorkspace = LeftHand:Clone()

is cloning the left hand from ServerStorage, to Workspace. I did this because I want to set the NetworkOwner for the hands to be the local client. The model has to start in the workspace in order to set the NetworkOwner.

After this, the line:

local LeftHandCloneCharacter = LeftHandCloneWorkspace:Clone()

is cloning the old clone (the one that went to workspace). This new clone is being parented to the LocalCharacter (as shown.)

After all of this, the entire process is done again, but with the right hand.

The print statement:

print(“Character Detected.”)

runs normally. This tells me that the code is able to get to the cloning section.

Well then, you’d need to do

repeat wait() until Character:FindFirstChild("LeftGrabHand")
1 Like

Its returning nil because local script can’t access ServerStorage

1 Like

the local script is not accessing the ServerStorage. There is a differnet ServerScript that is doing that

I did it! I had to clone the GrabSphere separately as it’s own part, then parent it to the Character’s hands!

image

Thank you guys very very much! Ill make sure to credit you when i get the chance :wink:

1 Like

Just use WaitForChild. This approach is both messy and likely to cause performance issues.

3 Likes

I already suggested that and it didn’t work.

1 Like

There is no situation that would work and WaitForChild would not.

2 Likes

Also, the problem wasn’t that, it was the hands not cloning on the character and now he fixed it. I did suggested WaitForChild at first. :man_shrugging: ^^ Let’s debate about that for the few coming hours ;D

2 Likes

Yeah, I’m just clarifying that was not the fix and should not be marked as the solution. One of your earlier posts should’ve probably been marked since it’ll be more helpful to future people browsing this topic, or his own post explaining what the problem was.

3 Likes

He only marked my message as a solution cuz I was here the whole time so :man_shrugging: I mean, why should we care bout that? The problem’s fixed… As for the future people, they can just re-read the conversation. Also, yea, I do agree he could’ve marked his message as the solution tho.

1 Like

sorry for being a bit late but…

yes i did mark @Epic_Player16 's post correct because he has been here the entire time.

Thank you. Well, just mark yours as the solution since it’s the right fix.

1 Like

alright then lol. Thanks again for helping me out with the stuff earlier tho.

1 Like