Skip to content

Player Module

The player module gives access to your character, inventory, camera controls, and player events.


FunctionReturnsDescription
player.scrap()numberReturns your current Scrap balance.
player.calculateFinalScrap(number)numberCalculates a value with all multipliers applied.
lau-compiler.exe
print("Balance: " + player.scrap())
print("Total Inventory Value: " + player.calculateFinalScrap(12500))
OUTPUT:
Balance: 5400 Total Inventory Value: 12500

FunctionReturnsDescription
player.getInventory()listReturns the full inventory as a list.
player.getInventorySize()numberReturns the total inventory size.
player.getFruitCapacity()numberReturns the maximum fruit capacity.
player.getItem(index)tableReturns the item data at the given slot.
player.getTileNumber()numberReturns the current tile number.
if player.getInventorySize() >= player.getFruitCapacity() then
player.alert("Inventory full")
end

FunctionReturnsDescription
player.sent(message)voidSends a normal message to the player.
player.alert(message)voidSends a warning alert to the player.

FunctionReturnsDescription
player.getCurrentTile()number, numberReturns the X and Z position of the current tile.
player.camera(mode?)Enum.CameraGets or sets the camera target.
player.cameraMode(mode?)Enum.CameraModeGets or sets the camera behavior mode.
FunctionReturnsDescription
player.controlEnabled(enabled?)booleanGets or sets whether player controls are enabled.

Triggered when the player sends a chat message.

player.chatted:connect(func(msg)
if msg == "start" then
player.sent("Automation sequence initiated.")
end
end)

Triggered when a key is pressed.

player.input:connect(func(key)
if key == Enum.KeyCode.E then
player.sent("E key pressed!")
end
end)