So basically I got a gun system and i got a script that makes it drop bullet shells but the problem is it drops the shells when the gun is empty. Heres the script:
local tool = script.Parent
local shell = game.ReplicatedStorage:WaitForChild("PistolShell")
tool.Activated:Connect(function()
local shellClone = shell:Clone()
shellClone.CanCollide = true
shellClone.Parent = workspace
wait()
local shellPos = script.Parent.Bolt.Position
shellClone.Position = Vector3.new(shellPos.X, shellPos.Y, shellPos.Z)
wait(2)
shellClone.CanCollide = false
end)
Thanks

1 comment
Ofc it will keep going even if it is 'empty'. You didn't put a if statement to check if it is empty.