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

What's the prefix for Right arm or left arm?

Asked by
2Busy 10
9 years ago

String value? Because I can't seem to add a space when searching Right leg Right arm, etc.

1 answer

Log in to vote
2
Answered by 9 years ago

So, from the comments I assume that this is fired when something is hit.

if hit.Parent:FindFirstChild("Humanoid") then
    local arms = { hit.Parent["Left Arm"], hit.Parent["Right Arm"] } -- Put the arms in a table
    for i,v in pairs(arms) do -- Loop through the arms
        if hit.Name == v.Name then -- Check which arm is hit
            script.Parent.CFrame = CFrame.new(arms[i].Position) * CFrame.new() -- Set the CFrame position to the current arm
        end
    end
end 

Edit: OffTopic: What's up with all these random down voters?

1
How would I put ["Right Arm"] in this Welding script? rarm = hit.Parent.???? script.Parent.CFrame = rarm.CFrame * CFrame.new(0,0,0) 2Busy 10 — 9y
1
Create some locals defining the arms. Local rarm = hit.Parent["Right Arm"] damagex443 325 — 9y
1
THANKS! 2Busy 10 — 9y
Ad

Answer this question