I’ve been following this tutorial on how to make an fps and I’m on part 2 and I’ve followed everything this tutorial said and it still won’t work and I’ve checked everything and since this error is so specific I can’t get any help on this except for the fact that this means the script doesn’t know what ‘aimSmooth’ means.
Framework script:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local camera = game.Workspace.CurrentCamera
local aimCF = CFrame.new()
local isAiming = false
local framework = {
inventory = {
"M4A1";
"M9";
"Deagle";
"Frag";
};
module = nil;
viewmodel = nil;
currentSlot = 1;
}
function loadSlot(item)
local viewmodelFolder = game.ReplicatedStorage.ViewModels
local moduleFolder = game.ReplicatedStorage.Modules
for i, v in pairs(camera:GetChildren()) do
if v:IsA("Model") then
v:Destroy()
end
end
if moduleFolder:FindFirstChild(item) then
framework.viewmodel = viewmodelFolder:FindFirstChild(item):Clone()
framework.viewmodel.Parent = camera
end
end
RunService.RenderStepped:Connect(function()
for i, v in pairs(camera:GetChildren()) do
if v:IsA("Model") then
v:SetPrimaryPartCFrame(camera.CFrame * aimCF)
end
end
if isAiming and framework.viewmodel ~= nil and framework.module.canAim then
local offset = framework.viewmodel.AimPart.CFrame:ToObjectSpace(framework.viewmodel.PrimaryPart.CFrame)
aimCF = aimCF:Lerp(offset, framework.module.aimSmooth)
else
local offset = CFrame.new()
aimCF = aimCF:Lerp(offset, framework.module.aimSmooth)
end
end)
loadSlot(framework.inventory[1])
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.One then
if framework.currentSlot ~= 1 then
loadSlot(framework.inventory[1])
framework.currentSlot = 1
end
end
if input.KeyCode == Enum.KeyCode.Two then
if framework.currentSlot ~= 2 then
loadSlot(framework.inventory[2])
framework.currentSlot = 2
end
end
if input.KeyCode == Enum.KeyCode.Three then
if framework.currentSlot ~= 3 then
loadSlot(framework.inventory[3])
framework.currentSlot = 3
end
end
if input.KeyCode == Enum.KeyCode.Four then
if framework.currentSlot ~= 4 then
loadSlot(framework.inventory[4])
framework.currentSlot = 4
end
end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
isAiming = true
end
end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton2 then
isAiming = false
end
end)
M9 module script:
local Settings = {
canAim = true;
aimSmooth = .15;
}
return Settings
M4A1 module script:
local Settings = {
canAim = true;
aimSmooth = .125;
}
return Settings
Nobody in the video comments seem to have a problem with this.