Hello!
I am trying to make bullet holes, but it’ not working as expected, this is code:
Tool.Events.Hit.OnServerEvent:Connect(function(plr,hit,position)
if hit.Parent ~= nil then
if hit.Parent:FindFirstChild('Humanoid') then
local Bloo = script.Blo:Clone()
Bloo.Parent = hit
Bloo.Name = 'Connection'
hit.Parent.Humanoid:TakeDamage(DamageHandler[hit.Name])
delay(0.4, function()
Bloo:Destroy()
end)
end
local Hole = script.BulletHole:Clone()
Hole.CFrame = CFrame.new(position) * CFrame.Angles(hit.Orientation.X, math.rad(hit.Orientation.Y), math.rad(hit.Orientation.Z))
Hole.Parent = workspace.IgnoreParts
game:GetService('Debris'):AddItem(Hole, 7)
end
end)
The reason this isn’t working is because your getting the orientation of the part, not the orientation of the side that your clicking. Therefore the bullets orientation will always equal the parts orientation.