This is the full function: ```lua
function OnRayHit(cast, raycastResult, segmentVelocity, cosmeticBulletObject)
-- This function will be connected to the Caster's "RayHit" event.
local hitPart = raycastResult.Instance
local hitPoint = raycastResult.Position
local normal = raycastResult.Normal
print("It got triggered")
if hitPart ~= nil and hitPart.Parent ~= nil then -- Test if we hit something
local humanoid = hitPart.Parent:FindFirstChildOfClass("Humanoid") -- Is there a humanoid?
if humanoid then
humanoid:TakeDamage(10)
end
coroutine.wrap(function()
explosion(hitPoint, normal)
end)()
coroutine.wrap(function()
local WeldConstraint1 = game.Workspace.Terrain:WaitForChild("Part").WeldConstraint
WeldConstraint1.Part1 = hitPart.Parent:WaitForChild("HumanoidRootPart")
print("It got triggered 2")
end)()
end
return true
end