function GetTerrainForMouse(t)local K=(game:GetService("\087\111\114\107\115\112\097\099\101")).Terrain:WorldToCellPreferSolid(Vector3.new(t.hit.x,t.hit.y,t.hit.z))local s=nil local o=nil if 0==((game:GetService("\087\111\114\107\115\112\097\099\101")).Terrain:GetCell(K.X,K.Y,K.Z)).Value then K=nil s,o=PlaneIntersection(Vector3.new(t.hit.x,t.hit.y,t.hit.z))if o then K=s end end return K end

function GetTerrainForMouse(mouse)
	-- There was no target, so all it could be is a plane intersection.
	-- Check for a plane intersection.  If there isn't one then nothing will get hit.
	local cell = game:GetService("Workspace").Terrain:WorldToCellPreferSolid(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z))
	local planeLoc = nil
	local hit = nil
	-- If nothing was hit, do the plane intersection.
	if 0 == game:GetService("Workspace").Terrain:GetCell(cell.X, cell.Y, cell.Z).Value then
		cell = nil
		planeLoc, hit = PlaneIntersection(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z))
		if hit then
			cell = planeLoc
		end
	end
	return cell
end
