Unable to get right arm from character?

I’m using r6 just to clear that up.

So i’m trying to get the right arm from the character but it keeps giving me this error: https://gyazo.com/55f3e8be8d5d9604caadca34453b4b5f

I’ve tried doing :WaitForChild() but that gives me the infinite yield possible error.

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local RepStorage = game:GetService("ReplicatedStorage")
local PunchRemote = RepStorage.Punch
local db = true
local Damaged = false
local UIS = game:GetService("UserInputService")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://05010685080"

Character["Right Arm"].Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and not db and not Damaged and hit.Parent.Humanoid ~= Player.Character.Humanoid then
		if Character.Humanoid.Health > 0  then
			Damaged = true
			PunchRemote:FireServer(hit.Parent.Humanoid)
		end
	end
end)

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.E and db then
		db = false
		local Anim1 = Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
		Anim1:Play()
		wait(0.8)
		Damaged = false
		db = false
	end
end)

You are using R15 which doesn’t have 1 part for an entire limb. Perhaps try using the RightHand.

Your game/character might be R15. And RightArm is used only for R6

I’m using R6. (30 characters) (30 characters)

Try adding a wait(5) or wait(10) at the top of the script in case the character hasn’t loaded yet.

1 Like

It would be better to actually just do

humanoid = character:WaitForChild(“Humanoid”)

In essence, what you said was correct however we want to limit the wait time only to what is necessary to when the humanoid object itself will load.

1 Like

I wrote that almost 3 years ago when I wasn’t experienced but yes I agree.

Damn, and to see that your actually still in the forum, I am literally only on my first month but I really like this forum. I did not mean that you were inexperienced but more for just documentation purposes if other people search it up on google

1 Like

@BPilot253 @legendarysword4567 I’m just sad to find out that 3 years have passed since I made this thread… where’d all the time go! :disappointed_relieved:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.