The else statement wont run?
01 | local Damage = game.ReplicatedStorage.Guns.Colt.Damage.Value |
02 | local Ammo = game.ReplicatedStorage.Guns.Colt.Ammo.Value |
03 | local MaxAmmo = game.ReplicatedStorage.Guns.Colt.MaxAmmo.Value |
04 | local AmmoReloadTime = game.ReplicatedStorage.Guns.Colt.ReloadTime.Value |
06 | local Player = game.Players.LocalPlayer |
07 | local Mouse = Player:GetMouse() |
09 | local Handle = script.Parent.Handle |
10 | local Colt = script.Parent |
12 | script.Parent.Activated:Connect( function () |
16 | game.ReplicatedStorage.Guns.Colt.Ammo.Value = game.ReplicatedStorage.Guns.Colt.Ammo.Value - 1 |
18 | if Mouse.Target~ = nil then |
19 | if Mouse.Target.Parent:FindFirstChild( 'Humanoid' ) then |
20 | print ( 'targetted player' ) |
21 | game.ReplicatedStorage.Guns.Fire:FireServer(Damage, Ammo, MaxAmmo, Mouse, Mouse.Target, AmmoReloadTime) |
iin the else statement, it never prints or does what i put in the else statement. the ammo number goes to negative and still damages players what do i do to make it stop when the ammo is = 0