Sup!
I am making a fps game… and the issue is that if the bullet Raycasts… the Accesories of an avatar are counting as a part, because of the Handle’s.
I tried to fix this, but didn’t manage to, so i decided to ask you!
The script that has the error:
local Hit = workspace:Raycast(bullet.Position, bullet.CFrame.LookVector * velocity * 1.5)
local HeadShot = false
if Hit then
local HitCharacter = Hit.Instance.Parent
local Humanoid = Hit.Instance.Parent:FindFirstChild("Humanoid")
local HRP = Hit.Instance.Parent:FindFirstChild("HumanoidRootPart")
if Hit.Instance ~= Hit.Instance:FindFirstChild("Handle") then
if HitCharacter and Humanoid then
if HitCharacter ~= killer.Character then
if Hit.Instance == Hit.Instance.Parent:FindFirstChild("Head") then
HeadShot = true
end
print(Hit.Instance)
damage:FireServer(Hit.Instance.Parent, killer, HeadShot, CA)
HeadShot = false
return
else
return
end
elseif Hit.Instance == Hit.Instance:FindFirstChild("Handle") or HitCharacter:IsA("Accessory") then
print("a")
else
print("ow")
Loop:Disconnect()
bullet:Destroy()
return
end
end
end