Create floor in room schedule floor can show correct room name and number

Thank you for your help. I created script follow this solution but have some problem. When created floor the floor is in the wrong room. How can set floor link in the room?