Loading

Paste #pnckza9mu

  1. --Called when the patient sits up from a bench for whatever reason
  2. --Maybe related to Humanoid:removedObject(object)
  3. function Bench:removeUser(user)
  4.   if user then
  5.     local has_idle = false
  6.     for i, action in pairs(user.action_queue) do
  7.       if action.name == "idle" then
  8.         has_idle = true
  9.       end
  10.     end
  11.  
  12.     -- patient must idle && action:isStanding() == true at this point
  13.     if has_idle == true then
  14.       user:notifyNewObject("bench")
  15.     end
  16.   end
  17.  
  18.   return Object.removeUser(self, user)
  19. end

Comments