local lastFired = tick()
game:GetService("RunService").RenderStepped:Connect(function()
if firing then
if tick() - lastFired > fireDelay then
gunShoot:FireServer(m.Hit.p, muzzle.CFrame.p)
lastFired = tick()
end
if tick() - lastFired > 0.3 then
local GunShellClone = gunshell:Clone()
GunShellClone.Parent = game:GetService("Workspace")
GunShellClone.CFrame = muzzle.CFrame + Vector3.new(0, 0, 0)
GunShellClone.Velocity = -(muzzle.CFrame.RightVector) * 10
GunShellClone.CFrame = GunShellClone.CFrame * CFrame.Angles(math.random(0.3, 1), math.random(0.3, 1), math.random(0.3, 1))
local GunShellClone_sound = gunshell_sound:Clone()
GunShellClone_sound.Parent = muzzle
GunShellClone_sound:Play()
wait(5)
GunShellClone:Destroy()
end
end
end)
So I wrote some code to make a full auto rifle full auto as well as a script for shell ejection. When I checked, the shells do get cloned, but for some reason in this instance they don't appear at all cause of the full auto thing not working out for the shells. First try they appeared first before the bullets and bullets only appeared after (the code was a bit different), second time they appeared once and stop appearing (also different code), and now they don't appear at all! I just need to get the ejected shells to appear at a slower rate as well as some camera shake at a slower rate from the full auto fire rate which is 0.1. Please help me.

4 comments
You will get a lot of GunShellClone_sound since you never destroy it
Wait are you saying that fireDelay is equal to 0.1? Then your if tick() - lastFired > 0.3 will never run. Since every time tick() - lastFired > 0.1 you reset lastFired, it will never get greater than 0.3
I see, perhaps there's a way I can fix that? What would it look like?
Okay, so I got it by making a seperate lastFired-like variable. Thank you.