so im making a game with a tombstone which is supposed to write something on the label when a player hits it. The problem is it only detects normal people, and it doesnt detect dead ragdolls. I'm not getting any errors, but here is what i made so far to make it work (it still doesnt tho)
local part = script.Parent
local text = part.Parent.Part.SurfaceGui.BuriedNickname
part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local plr = game.Players:GetPlayerFromCharacter(humanoid.Parent)
text.Text = humanoid.Parent.Name .. "- died from some disease ~ lived for ".. plr.AccountAge .. " days."
end
end)

2 comments
I think the problem is that when the body parts of the character are deleted, the touched event don't fire anymore. Since the problem is probably related with the ragdoll script, why don't you make your own?
im a beginner and i have no idea how to