I have this script right here thats is located in a ModuleScript:
s = {
weaponpPosition = CFrame.new(0.2,-1.4,0.6);
}
return true
And this one is Framework for the gun view model and its located in StarterCharacterScripts as a LocalScript:
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 setting = require(game.ReplicatedStorage.WeaponModules.Deagle)
run.RenderStepped:connect(function()
gun:SetPrimaryPartCFrame(cam.CFrame * CFrame.new(setting.weaponpos)) --The Error
end)
gun.Parent = cam
local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.WeaponModules.Deagle.Animations.Idle)
idle:Play()
However whenever I try to run the game, the arms with the gun view model wont work, it gets stuck in the workspace midair. And I get this error saying Workspace.RoiGipot.Framework:12: attempt to index upvalue 'setting' (a boolean value)
It should be on my screen, rotating and moving with me. But its like a model in Workspace, and its in Camera.
Why I get this error?

2 comments
try to return s instead of true, which is the boolean value
Thank you so much! It worked!