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

Fake Arms Cframe?

What I'm Trying To Do So I got this arm script working but I can't seem to cframe it to a 90 degree angle and In a position of the player holding the gun. Could you guys help me with this? Thanks.

Debounce = false
game.Workspace.ChildAdded:connect(function(Player)
Character respawn or load
local Humanoid = Player:FindFirstChild("Humanoid")
if Humanoid then
if not Debounce then 
	Debounce = true

local ArmStorage = game.Workspace:FindFirstChild("ArmStorage")
if not ArmStorage then
	local Model = Instance.new("Model", game.Workspace)
    Model.Name = "ArmStorage"
end 
	wait(1)
print("Player Character Has Loaded")
	local FakeArmL = Player["Left Arm"]:Clone()
	FakeArmL.Name = "FakeArmL"
	FakeArmL.Parent = game.Workspace.ArmStorage
	FakeArmL.CFrame = Player["Left Arm"].CFrame -- I tryed doing this but it did not work  + Cframe.new(0,0,0)
	local Weld1 = Instance.new("Weld", FakeArmL)
    	Weld1.Part1 = Player["Left Arm"]       
	Weld1.Part0 = FakeArmL
	Player["Left Arm"].Transparency = 1

	local FakeArmR = Player["Right Arm"]:Clone()
	FakeArmR.Name = "FakeArmR"
	FakeArmR.Parent = game.Workspace.ArmStorage
	FakeArmR.CFrame = Player["Right Arm"].CFrame -- I tryed doing this but it did not work  + Cframe.new(0,0,0)
	local Weld2 = Instance.new("Weld", FakeArmR)
  		 Weld2.Part1 = Player["Right Arm"]
    	Weld2.Part0 = FakeArmR
		Player["Right Arm"].Transparency = 1
	Debounce = false
end end end)

1 answer

✓ Accepted answer

I would just do the cframing with the weld, shown below in some code I was working on

Head = Character:WaitForChild("Head")
Torso = Character:WaitForChild("Torso")
HumRootPart = Character:WaitForChild("HumanoidRootPart")
LArm = Character:WaitForChild("Left Arm")
RArm = Character:WaitForChild("Right Arm")
LLeg = Character:WaitForChild("Left Leg")
RLeg = Character:WaitForChild("Right Leg")

function Equipped()
	local RArmWeld = Instance.new("Weld")
	RArmWeld.Parent = Character
	RArmWeld.Part0 = RArm -- Instead of attaching player arm, use the fake arm here
	RArmWeld.Part1 = HumRootPart
	RArmWeld.C0 = CFrame.new(0,0,0) * CFrame.Angles(0,0,0)
end

1 comment

0

Did some edits, forgot to put a few things in

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