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

How can I make this script's compability to be changed from R15 to R6 between the Lines in 7 and 12?

Asked by 5 years ago
script.Parent.ClickDetector.MouseClick:Connect(function(player)
 local take = script.Parent.Parent.Taken
if take.Value == 'false' and script.Parent.Parent.Anim.Value == 'false' then
    take.Value = 'true'
    local box = script.Parent.JobBox:Clone()
    box.Anchored = false
    box.Parent = workspace:FindFirstChild(player.Name).RightHand

    local weld = Instance.new('Weld')
    weld.Parent = box
    weld.Part0 = box
    weld.Part1 = workspace:FindFirstChild(player.Name).RightHand
    weld.C0 = CFrame.new(1,0.5,0)
    script.Parent.Parent.Anim.Value = 'true'
    local char = workspace:FindFirstChild(player.Name)
    local flip = Instance.new("Animation")

            flip.AnimationId = "http://www.roblox.com/asset/?id=03571563488"
            flip.Parent = char
            local animloader2 = char.Humanoid:LoadAnimation(flip )
            animloader2:Play()
            script.Parent.Parent.Owner.Value = player.Name

while(1) do
    wait(1)
    if script.Parent.Parent.Anim.Value == 'false' then
    animloader2:Stop()

    end
end     

end
end)

0
is this not already compatible with r6? SmartNode 383 — 5y
1
Obviously not, As there is no RightHand in a R6 rig Simpletton 82 — 5y

1 answer

Log in to vote
0
Answered by
Psudar 882 Moderation Voter
5 years ago

I would suggest using a different method to get the player's character, like player.Character but anyway, the only thing you need to change for the RightHand is change it to "Right Arm".

workspace:FindFirstChild(player.Name)["Right Arm"]

or

player.Character:FindFirstChild("Right Arm")

And yes, there is a space between Right and Arm.

https://developer.roblox.com/en-us/articles/roblox-avatars

If you wanted it to be compatible with both R15 and R6, you could just use the or condition.

Ad

Answer this question