Bad argument #2 (vector3 expected , got nil)

So when i click play i get a error in output saying “bad argument #2 (vector3 expected , got nil)”
Heres the first script

local player = game.Players.LocalPlayer

local run = game:GetService(“RunService”)

local cam = workspace.CurrentCamera

local gun = game.ReplicatedStorage.Weapons.Deagle:Clone()

gun:SetPrimaryPartCFrame(cam.CFrame)

local s = require(game.ReplicatedStorage.WeaponModules.Deagle)

run.RenderStepped:connect(function()

gun:SetPrimaryPartCFrame(cam.CFrame * s.weaponpos)

end)

gun.Parent = cam

local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponModules.Deagle.Animations.Idle)

idle:Play()

The modulescript named “Deagle” is this

local module = {

setting = {

rpm = 750;

weaponpos = CFrame.new(0,0,0);

}

}

return module

im trying to make fps arms btw

Which line is the error on? This will help us see where the error is so we can help you better :smiley:

s.weaponpos should be s.setting.weaponpos

3 Likes

the line where the error on is line 13

This worked thanks :slight_smile: