So for the past hour I’ve been trying to fix this error but i cant , so i decided to get some help.
Here’s the script:
– SERVICES –
local Players = game:GetService(“Players”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local ContextActionService = game:GetService(“ContextActionService”)
– VARIABLES –
local player = Players.LocalPlayer
local gun = script.Parent
local mouse = player:GetMouse()
mouse.TargetFilter = workspace.FilteringFolder
local properties = require(gun.Properties)
local GunCommsEnum = require(ReplicatedStorage.Modules.Enums.GunCommsEnum)
local gunEvent = ReplicatedStorage.Remotes.GunEvent
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
local shotCooldown = 60/properties.FireRate
local mouseButtonDown = false
local shooting = false
local reloading = false
– PRIVATE FUNCTIONS –
local function createAnimationTrack(animId) :AnimationTrack
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild(“Humanoid”)
local animator = hum:WaitForChild(“Animator”)
local animation = Instance.new("Animation")
animation.AnimationId = animId
local track = animator:LoadAnimation(animation)
game:GetService('RunService').Stepped:Wait()
return track
end
local equipTrack = createAnimationTrack(properties.Animations.Equip)
local shootTrack = createAnimationTrack(properties.Animations.Shoot)
local reloadTrack = createAnimationTrack(properties.Animations.Reload)
(JUST SAYING THIS SCRIPT IS A GUN SCRIPT)
IM MAKING MY ANIMS FFOR MY GUNS