local function R(R)if orientableBodies[R]then orientableBodies[R]:destroy()orientableBodies[R]=nil end if characterAddedConnections[R]then characterAddedConnections[R]:Disconnect()characterAddedConnections[R]=nil end if characterRemovingConnections[R]then characterRemovingConnections[R]:Disconnect()characterRemovingConnections[R]=nil end end
-- Clear orientable body event listeners for a given player
local function onPlayerRemoving(player)
	if orientableBodies[player] then
		orientableBodies[player]:destroy()
		orientableBodies[player] = nil
	end
	if characterAddedConnections[player] then
		characterAddedConnections[player]:Disconnect()
		characterAddedConnections[player] = nil
	end
	if characterRemovingConnections[player] then
		characterRemovingConnections[player]:Disconnect()
		characterRemovingConnections[player] = nil
	end
end
