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

How do I make the script recognize an R6 player's Right arm?

I've been trying to have the script recognize the R6 player's Right Arm, but nothing I tried has worked. Can anyone help me? This is for a tool.

local tool = script.Parent
local player = tool.Parent.Parent
local char = player.Character
 
local function onEquip()
	char["Right Hand"]:WaitForChild("RightGrip"):Destroy()
	--weld to right arm with a motor 6D weld
	local Motor6D = Instance.new("Motor6D",char.RightHand)
	Motor6D.Name = "Handle"
	Motor6D.Handle = char.RightHand
	Motor6D.Parts = tool.Handle
	--inseting the equip animation
	local Anim = Instance.new('Animation')
	Anim.AnimationId = "rbxassetid://5182371679"
	AnimTrack = char.Humanoid:LoadAnimation(Anim)
	AnimTrack:Play()
	Motor6D.C0 = CFrame.new(0,0,0)
	
end
 
local function onUnequip()
	if char.RightHand:FindFirstChild("Handle")then
		char.RightHand.Handle:Destroy() --gets rid of motor 6d
	end
	AnimTrack:Stop()
end
 
local function onActivate() --when you click
end
 
local function onDeactivate()
end
 
tool.Equipped:Connect(onEquip)
tool.Unequipped:Connect(onUnequip)
tool.Activated:Connect(onActivate)
tool.Deactivated:Connect(onDeactivate)

2 comments

0

Change "Right Hand" to "Right Arm"

0

Thank you.

1 answer

✓ Accepted answer

Change "char["Right Hand"] " to "char["Right Arm"] "

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