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

How would I do this?

Asked by 9 years ago

Alright, so I put a tool in StarterPack with only one brick named Handle.

I made a walking animation and the arms move. I want to make it so that when I am walking, the arms aren't straight out when I have my tool equipped, instead they are following the arm. I realized I needed to weld the handle to my hand. So I did so:

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
function OnEquipped()
    if humanoid then
    print(character.Name .. " has equipped the weapon.") -- Shows who equipped the weapon
    rightArm = character:findFirstChild("Right Arm") -- Uses variable rightArm representing Right Arm in character
    script.Parent.CFrame = rightArm.CFrame * CFrame.new(0,1,0)
    weld = Instance.new("Weld") -- Creates new weld
    weld.Parent = script.Parent
    weld.Part0 = rightArm
    weld.C0 = rightArm.CFrame:inverse()
    weld.Part1 = script.Parent
    weld.C1 = script.Parent.CFrame:inverse()

    script.Parent.Anchored = false
    end
    end

script.Parent.Parent.Equipped:connect(OnEquipped)

This did not work.

Are there any ways I can do this?

1
For future reference, your question title needs to be more specific so people know if they can help you Validark 1580 — 9y

1 answer

Log in to vote
0
Answered by
crut24 50
9 years ago

Dont use a Tool use a Hopperbin

Ad

Answer this question