local t=Players.LocalPlayer local e=Workspace.Effects return function(t)local o=t.HumanoidRootPart local R=Ray.new(o.Position,Vector3.new(0,-50,0))local s,q,J=Workspace:FindPartOnRayWithIgnoreList(R,{t;e})if s then for t,e in pairs(t:GetDescendants())do if e:IsA("\066\097\115\101\080\097\114\116")then e.Transparency=1 elseif e:IsA("\068\101\099\097\108")then e.Transparency=1 end end local o=math.rad(math.random(360))local R=script.Gravestone:Clone()R.Dirt.CFrame=(CFrame.new(q,q+J)*CFrame.Angles(-math.pi/2,0,0))*CFrame.Angles(0,o,0)R.Stone.CFrame=((CFrame.new(q,q+J)*CFrame.Angles(-math.pi/2,0,0))*CFrame.new(0,R.Stone.Size.Y/2,0))*CFrame.Angles(0,o,0)R.Parent=e R.Dirt.DirtEmitter:Emit(10)R.Dirt.ImpactEmitter:Emit(10)end end
-- constants

local PLAYER = Players.LocalPlayer
local EFFECTS = Workspace.Effects

return function(character)
	local rootPart = character.HumanoidRootPart

	local ray = Ray.new(rootPart.Position, Vector3.new(0, -50, 0))
	local h, p, n = Workspace:FindPartOnRayWithIgnoreList(ray, { character, EFFECTS })

	if h then
		for _, v in pairs(character:GetDescendants()) do
			if v:IsA("BasePart") then
				v.Transparency = 1
			elseif v:IsA("Decal") then
				v.Transparency = 1
			end
		end

		local angle = math.rad(math.random(360))

		local gravestone = script.Gravestone:Clone()
		gravestone.Dirt.CFrame = CFrame.new(p, p + n) * CFrame.Angles(-math.pi / 2, 0, 0) * CFrame.Angles(0, angle, 0)
		gravestone.Stone.CFrame = CFrame.new(p, p + n)
			* CFrame.Angles(-math.pi / 2, 0, 0)
			* CFrame.new(0, gravestone.Stone.Size.Y / 2, 0)
			* CFrame.Angles(0, angle, 0)
		gravestone.Parent = EFFECTS

		gravestone.Dirt.DirtEmitter:Emit(10)
		gravestone.Dirt.ImpactEmitter:Emit(10)
	end
end
