Player

Variables

addMessage(text)

Add message to chat.

Returns:

  • (boolean) Return (true) if successfully.

Example Usage:

-- Example code showing how to use the function
player.addMessage("Hypixel Cry - Only me see this")

sendMessage(text)

Send message to server.

Returns:

  • (boolean) Return (true) if successfully.

Example Usage:

-- Example code showing how to use the function
player.sendMessage("Hypixel Cry - All see this")

sendCommand(text)

Send command to server.

Returns:

  • (boolean) Return (true) if successfully.

Example Usage:

-- Example code showing how to use the function
player.sendCommand("/warp hub")

getName()

Returns the player name.

Returns:

  • (string) Player name.

Example Usage:

-- Example code showing how to use the function
local name = player.getName()

getRotation()

Returns the player rotation.

Returns:

  • (table) - Position table (yaw, pitch)

Example Usage:

-- Example code showing how to use the function
local rotation = player.getRotation()
local yaw = rotation.yaw -- Number
local pitch = rotation.pitch -- Number

setRotation(yaw, pitch)

Returns the player rotation.

Parameters:

  • yaw (number) - Player yaw.

  • pitch (number) - Player yaw.

Example Usage:

-- Example code showing how to use the function
player.setRotation(90, 90)

getPos()

Returns the player position.

Returns:

  • (table) - Position table (x, y, z)

Example Usage:

-- Example code showing how to use the function
local pos = player.getPos()
local x = pos.x -- Number
local y = pos.y -- Number
local z = pos.z -- Number

getLocation()

Returns the player location.

Returns:

  • (string) Player location.

Example Usage:

-- Example code showing how to use the function
local location = player.getLocation()

getPurse()

Returns the player purse.

Returns:

  • (number) Player purse.

Example Usage:

-- Example code showing how to use the function
local purse = player.getPurse()

getHealth()

Returns the player health.

Returns:

  • (number) Player heath.

Example Usage:

-- Example code showing how to use the function
local health = player.getHealth()

getMana()

Returns the player mana.

Returns:

  • (number) Player mana.

Example Usage:

-- Example code showing how to use the function
local mana = player.getMana()

getDefence()

Returns the player defence.

Returns:

  • (number) Player defence.

Example Usage:

-- Example code showing how to use the function
local defence = player.getDefence()

getSpeed()

Returns the player speed.

Returns:

  • (number) Player speed.

Example Usage:

-- Example code showing how to use the function
local speed = player.getSpeed()

getCold()

Returns the player cold in glacite tunnels.

Returns:

  • (number) Player cold.

Example Usage:

-- Example code showing how to use the function
local cold = player.getCold()

isSneaking()

Returns the player is sneaking.

Returns:

  • (boolean) is player sneaking.

Example Usage:

-- Example code showing how to use the function
local isSneaking = player.isSneaking()

isSprinting()

Returns the player is sprinting.

Returns:

  • (boolean) is player sprinting.

Example Usage:

-- Example code showing how to use the function
local isSprinting = player.isSprinting()

isOnGround()

Returns the player is on ground.

Returns:

  • (boolean) is player on ground.

Example Usage:

-- Example code showing how to use the function
local isOnGround = player.isOnGround()

isOnSkyBlock()

Returns the player is on skyblock.

Returns:

  • (boolean) is player on skyblock.

Example Usage:

-- Example code showing how to use the function
local isOnSkyBlock = player.isOnSkyBlock()

Returns scoreboard lines.

getScoreBoardLines()

Returns:

  • (table) list of lines.

Example Usage:

-- Example code showing how to use the function
local scoreboard = player.getScoreBoardLines()

for index, line in ipairs(scoreboard) do
    player.addMessage(line)
end

getEyePosition()

Returns player eye position.

Returns:

  • (table) eye position (x, y, z).

Example Usage:

-- Example code showing how to use the function
local eyePostion = player.getEyePosition()
local x = eyePostion.x -- Number
local y = eyePostion.y -- Number
local z = eyePostion.z -- Number

getLookEndPos(number)

Returns player eye end position.

Parameters:

  • distance (number) - Distance from the player's view.

Returns:

  • (table) eye end position (x, y, z).

Example Usage:

-- Example code showing how to use the function
local lookEndPosition = player.getLookEndPos(5.0)
local x = lookEndPosition.x -- Number
local y = lookEndPosition.y -- Number
local z = lookEndPosition.z -- Number

getLookEndPos(table)

Returns player eye end position.

Parameters:

  • table (x, y, z) - Table with end point coordinates.

Returns:

  • (table) eye end position (x, y, z).

Example Usage:

-- Example code showing how to use the function
local look = {
   x = 1,
   y = 1,
   z = 1
}

local lookEndPosition = player.getLookEndPos(look)
local x = lookEndPosition.x -- Number
local y = lookEndPosition.y -- Number
local z = lookEndPosition.z -- Number

raycast(number)

Returns raycast result from eye.

Parameters:

  • number - Raycast distances from eyes.

Returns:

Global

  • (table) Result of raycast.

If block

  • (table) (type, x, y, z) Result of raycast.

If entity

Example Usage:

-- Example code showing how to use the function
local raycastResult = player.raycast(4.5)
if raycastResult == nil then
   print("MISS")
else
   local resultType = raycastResult.type
   if resultType == "block" then
      local x = raycastResult.x -- Number
      local y = raycastResult.y -- Number
      local z = raycastResult.z -- Number
   elseif resultType == "entity" then
      local entityData = raycastResult.data
   end
end

Last updated