Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
JJ_ayx 4
3 years ago

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)
0
Change "Right Hand" to "Right Arm" GameBoyOtaku 63 — 3y
0
Thank you. JJ_ayx 4 — 3y

1 answer

Log in to vote
0
Answered by
3F1VE 257 Moderation Voter
3 years ago

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

Ad

Answer this question