local Damage = 25
local HeadshotDamage = 50
local Debounce = false
script.Parent.FireEv.OnServerEvent:Connect(function(Player, Shooter, MousePos)
if script.Parent.Ammo.Value == 0 then return end
script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1
script.Parent.FirePart.Fire:Play()
local Bullet = Instance.new("Part", workspace)
Bullet.CFrame = script.Parent.FirePart.CFrame
Bullet.Size = Vector3.new(0.15, 0.15, 0.15)
Bullet.BrickColor = BrickColor.new("Bright yellow")
Bullet.TopSurface = "Smooth"
Bullet.BottomSurface = "Smooth"
Bullet.Material = "Neon"
Bullet.CanCollide = false
local BVol = Instance.new("BodyVelocity", Bullet)
BVol.P = 5000
BVol.Velocity = MousePos.lookVector * 250
local I = 0
while I < 1000 do
Bullet.Touched:Connect(function(Toucher)
if Toucher.Parent == Shooter then return end
local Hum = Toucher.Parent.Humanoid
if not Hum then
I = 1000
Bullet:Destroy()
end
if Toucher.Name == "Head" then
Hum:TakeDamage(HeadshotDamage)
print(Hum.Parent.Name)
Hum.Died:Connect(function()
print("Oop, He ded")
local OwnerSpyVal = script.Parent.Parent:GetPlayerFromCharacter().Spy.Value
print("I wonder if he's the spy...")
if OwnerSpyVal == false and Hum.Parent:GetPlayerFromCharacter().Spy.Value == false then
print("Oh no he's not!")
script.Parent.Parent:GetPlayerFromCharacter():Kick()
end
end)
I = 1000
Bullet:Destroy()
else
Hum:TakeDamage(Damage)
I = 1000
Bullet:Destroy()
end
end)
I = I + 1
wait()
end
Bullet:Destroy()
end)
There are no errors, but when it reaches the point where it checks if a humanoid died, it doesn't print anything after I kill another player.

1 comment
I added to that, but it didn't seem to fix the issue