Player Module
The player module gives access to your character, inventory, camera controls, and player events.
Economy
Section titled “Economy”| Function | Returns | Description |
|---|---|---|
player.scrap() | number | Returns your current Scrap balance. |
player.calculateFinalScrap(number) | number | Calculates 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
Inventory
Section titled “Inventory”| Function | Returns | Description |
|---|---|---|
player.getInventory() | list | Returns the full inventory as a list. |
player.getInventorySize() | number | Returns the total inventory size. |
player.getFruitCapacity() | number | Returns the maximum fruit capacity. |
player.getItem(index) | table | Returns the item data at the given slot. |
player.getTileNumber() | number | Returns the current tile number. |
if player.getInventorySize() >= player.getFruitCapacity() then player.alert("Inventory full")endCommunication
Section titled “Communication”| Function | Returns | Description |
|---|---|---|
player.sent(message) | void | Sends a normal message to the player. |
player.alert(message) | void | Sends a warning alert to the player. |
Camera
Section titled “Camera”| Function | Returns | Description |
|---|---|---|
player.getCurrentTile() | number, number | Returns the X and Z position of the current tile. |
player.camera(mode?) | Enum.Camera | Gets or sets the camera target. |
player.cameraMode(mode?) | Enum.CameraMode | Gets or sets the camera behavior mode. |
Controls
Section titled “Controls”| Function | Returns | Description |
|---|---|---|
player.controlEnabled(enabled?) | boolean | Gets or sets whether player controls are enabled. |
Events
Section titled “Events”player.chatted
Section titled “player.chatted”Triggered when the player sends a chat message.
player.chatted:connect(func(msg) if msg == "start" then player.sent("Automation sequence initiated.") endend)player.input
Section titled “player.input”Triggered when a key is pressed.
player.input:connect(func(key) if key == Enum.KeyCode.E then player.sent("E key pressed!") endend)