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

FPS Arms going crazy?

Asked by 9 years ago

I've been making guns for a while and as I have, I have found different ways to work with roblox physics and making FPS arms that are only visible by you. However, there are some strange problems with it. I have built the FPS arms into my guns, and the gun will remove them when you unequip the gun, but the problem is, sometimes, some of the guns will anchor you to position 0, 0, 0 and won't let you out until you unequip the gun. This happens 1 out of 2 times. So I need this fixed badly. I'm don't understand welds too much, but I know they keep parts inside each other. Here is the part of the gun script that inserts the FPS arms:

--LOCALSCRIPT
local Arms = {Player.Character["Left Arm"], Player.Character["Right Arm"]}
local AM = Instance.new("Model", game.Workspace.CurrentCamera) --AM Stands for Arms Model
AM.Name = Player.Name.."FakeArms"
Arm1 = Instance.new("Part", AM)
Arm1.Name = "Left Arm"
Arm1.FormFactor = Enum.FormFactor.Symmetric
Arm1.CanCollide = false
Arm1.Size = Vector3.new(1, 2, 1)
Arm1.Transparency = 0
Arm1.BrickColor = BrickColor.new("Black")
local Mesh1 = Instance.new("BlockMesh", Arm1)
Mesh1.Scale = Vector3.new(0.9, 0.9, 0.9)
Arm2 = Instance.new("Part", AM)
Arm2.Name = "Right Arm"
Arm2.FormFactor = Enum.FormFactor.Symmetric
Arm2.CanCollide = false
Arm2.Size = Vector3.new(1, 2, 1)
Arm2.Transparency = 0
Arm2.BrickColor = BrickColor.new("Black")
local Mesh2 = Instance.new("BlockMesh", Arm2)
Mesh2.Scale = Vector3.new(0.9, 0.9, 0.9)
local W1 = Instance.new("Weld", Arm1)
W1.Part0 = Arms[1]
W1.Part1 = Arm1
local W2 = Instance.new("Weld", Arm2)
W2.Part0 = Arms[2]
W2.Part1 = Arm2

Any ideas as of why it does what it does?

1 answer

Log in to vote
0
Answered by 4 years ago

for FPS I prefer to use R6 real arms this is my local script:

plr = game.Players.LocalPlayer;
repeat wait() until plr.Character
char = plr.Character
m = plr:GetMouse()
game["Run Service"].RenderStepped:connect(function()
local c = game.Workspace.CurrentCamera

char.HumanoidRootPart["RootJoint"].C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55,3.15,0)

    char.Humanoid.CameraOffset = (char.HumanoidRootPart.CFrame+Vector3.new(0,0,0)):pointToObjectSpace(char.Head.CFrame.p + Vector3.new(0,-1.46,0))

end)
Ad

Answer this question