The part most definitely exists, see screenshots attached.
I’ve also tried using
Character:WaitForChild("Right Hand")
but I get an infinite yield.
Here’s is the code that checks for the Right Hand model, located in ServerScriptService:
game.ReplicatedStorage.CharSelected.OnServerEvent:Connect(function(player, cname)
cName = cname
Character = player.Character
end)
game.ReplicatedStorage.LeoKatana.OnServerEvent:Connect(function()
Character.Archivable = true
-- tool handling code
if cName == "Leonardo" then
print("Leonardo Chosen")
--create a fake arm
local FakeArm = Character.Torso:FindFirstChild('Right Arm')
if not FakeArm then
local FakeShoulder = Instance.new('Motor6D', Character.Torso)
FakeShoulder.Part0 = Character.Torso
FakeShoulder.Name = 'Right Shoulder'
FakeArm = Instance.new('Part', Character.Torso)
FakeArm.CanCollide = false
FakeArm.Transparency = 1
FakeArm.Name = 'Right Arm'
FakeArm.FormFactor = 'Custom'
FakeArm.Size = Vector3.new(0.5, 0.5, 0.5)
FakeShoulder.Part1 = FakeArm
end
local RightHand = Character["Right Hand"]
print("Right Hand found")
local RightMotor = Instance.new('Motor6D')
RightMotor.Parent = Character['Right Hand']
RightMotor.Part0 = Character['Right Hand']
RightMotor.C0 = CFrame.new()
RightMotor.C1 = CFrame.new()
end
I’m using a RemoteEvent to, once a character is selected, pass the Player’s name as a parameter, as well as CharacterName, a StringValue located inside the player.
If more details are needed, let me know.
Knowing me, it’s probably a very simple solution but I can’t figure it out for the life of me.
Is that “Right Hand” BasePart being instanced by the client? If so then its existence won’t be replicated to the server and thus from the server’s perspective no such instance named “Right Hand” exists.
Found a solution. For some reason it wouldn’t detect Right Hand in the playermodel until I passed the playername as a parameter through the LeoKatana RemoteEvent and used game.Workspace[PlayerName] to locate the player’s model.