Issue
Not Giving Out Any Errors, Just Not Dealing Damage On Hit
Code
This is the section that called the ray
(Loadout.Current Is The Player's Weapon) (gunset is a module script, and damage is set to 10)
local muzzle = loadout.current.Muzzle
local ray = Ray.new(muzzle.CFrame.p,muzzle.CFrame.lookVector*999)
local hit,pos = workspace:FindPartOnRayWithIgnoreList(ray,{ c})
if hit then
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(gunset.damage)
else
local bh = storage.GunEffects.BulletHole:Clone()
bh.Parent = workspace
bh.CFrame = CFrame.new(pos)
game.Debris:AddItem(bh,1) -- remove bullet hole in 1 second
delay(0,function()
for i = 0,1,.1 do
bh.Transparency = i -- make it fade out
rs:wait()
end
end)
end
end
