OSRS Plugin API
    Preparing search index...

    Class Player

    Implements

    Index

    Constructors

    Methods

    • Returns the name of the entity.

      Returns string

      Returns the name of the entity as a string.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      osrs.print(npc:getName())
      end
    • Returns if the entity is dead.

      Returns boolean

      Returns true if the entity is dead, false if not.

      local players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      osrs.printf("player %s isDead=%s", player:getName(), (player:isDead() and "true" or "false") )
      end
    • Returns whether or not the player is a member of the local players friends chat.

      Returns boolean

      Returns true if the player is a member of the local players friends chat, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isFriendChat() then
      osrs.print("I am in a friends chat with the local player!")
      end
      end
    • Returns whether or not the player is in a group (such as a clan) with the local player.

      Returns boolean

      Returns true if the player is in a group with the local player, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isGroup() then
      osrs.print("I am in a group with the local player!")
      end
      end
    • Returns if the entity has a headbar that is empty.

      Returns boolean

      Returns true if the entity has a headbar that is empty, false if not.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      if npc:isHeadbarEmpty() then
      osrs.printf("npc %d has an empty headbar", npc_id)
      end
      end
    • Returns if the entitys healthbar is rendered.

      Returns boolean

      Returns true if the entitys healthbar is rendered, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isHealthbarRendered() then
      osrs.printf("player %d healthbar is rendered!", player_id)
      end
      end
    • Returns whether or not the player is in the ignore list of the local player.

      Returns boolean

      Returns true if the player is in the ignore list of the local player, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isIgnored() then
      osrs.print("I am ignored by the local player!")
      end
      end
    • Returns the id of the entity that this entity is interacting with, returns -1 if there is none.

      Returns number

      Returns the id of the entity that this entity is interacting with.

      local npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      local npc = osrs.ClientOp.getNpcObj(npc_id)
      local target_id = npc:isInteracting()
      if target_id ~= -1 then
      local target = osrs.ClientOp.getNpcObj(target_id)
      osrs.printf("NPC %s is interacting with %s", npc:getName(), target:getName())
      end
      end
    • Returns whether or not the player is the local player.

      Returns boolean

      Returns true if the player is the local player, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isLocalPlayer() then
      osrs.print("I am the local player!")
      end
      end
    • Returns whether or not the player is a online friend of the local player.

      Returns boolean

      Returns true if the player is a online friend of the local player, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isOnlineFriend() then
      osrs.print("I am a friend to the local player!")
      end
      end
    • Returns whether or not the entitys 2D elements are rendered.

      Returns boolean

      Returns true if the the entitys 2D elements are rendered, false if not.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      if npc:isRendered2D() == 1540 then
      osrs.printf("NPC %d 2D elements are rendered!", npc_id)
      end
      end
    • Returns whether or not the entitys 3D elements are rendered.

      Returns boolean

      Returns true if the the entitys 3D elements are rendered, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isRendered3D() then
      osrs.print("player %d is rendered!", player_id)
      end
      end
    • Changes the rendering of the entitys 2D elements based on the given boolean.

      Parameters

      • shouldRender: boolean

        Boolean that will render 2D elements when true, and does not when false.

      Returns void

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      -- npcs will no longer have 2D elements rendered
      npc:render2D(false)
      end
    • Changes the rendering of the entitys 3D elements based on the given boolean.

      Parameters

      • shouldRender: boolean

        Boolean that will render 3D elements when true, and does not when false.

      Returns void

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      -- all players will no longer be rendered
      player:render3D(false)
      end