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

invalid argument #2 (Vector3 expected, got table) ???

Asked by 2 years ago
Edited 2 years ago

I wanted to learn how to make fps framework but i got this error can someoen help me??

The script--




repeat wait() until game:IsLoaded() local plr = game.Players.LocalPlayer local char = plr.Character local mouse = plr:GetMouse() local cam = workspace.CurrentCamera local Run = game:GetService("RunService") local RS = game.ReplicatedStorage local GunModules = RS:WaitForChild("GunModules") local GunModels = RS:WaitForChild("GunModels") local Primary = "AK74" local WeaponInHand local WeaponData local maincf = CFrame.new() plr.CameraMode = Enum.CameraMode.LockFirstPerson Run.RenderStepped:Connect(function() if WeaponInHand then WeaponInHand:SetPrimaryPartCFrame( cam.CFrame * maincf -- The error is here ) end end) function setup(weapon) WeaponData = require(GunModules:WaitForChild(weapon)) maincf = WeaponData WeaponInHand = GunModels:WaitForChild(weapon) WeaponInHand.PrimaryPart = WeaponInHand:WaitForChild("Handle") WeaponInHand.Parent = cam for i, part in pairs(WeaponInHand:GetChildren()) do if part:IsA("BasePart") then part.Anchored = true part.CanCollide = false end end end setup(Primary)

Answer this question