Player V2 API
The playerV2 module introduces Event-Driven programming to your character. Use these functions to trigger drone actions immediately after a purchase or to automate your daily rewards.
🎁 Daily Rewards
Section titled “🎁 Daily Rewards”Automate your income by ensuring you never miss a daily bonus.
| Function | Returns | Description |
|---|---|---|
playerV2.getGift() | boolean | Attempts to claim the daily reward. Returns true if successful. |
lau-compiler.exe
print("[System] Checking for gifts...")
if playerV2.getGift() then print("[System] Reward claimed successfully!")else print("[System] No rewards available yet.")endOUTPUT:
[System] Checking for gifts...
[System] Reward claimed successfully!
⚡ Transaction Events
Section titled “⚡ Transaction Events”These events trigger the moment you perform an action in the market. This allows your drone to react instantly without needing a while loop.
| Event | Description |
|---|---|
playerV2.boughtSeed | Triggers when a seed is successfully purchased from the market. |
playerV2.boughtGear | Triggers when a new tool or piece of equipment is purchased. |
Example: Auto-Planting on Purchase
Section titled “Example: Auto-Planting on Purchase”-- Every time you buy a seed, the drone immediately moves and plants itplayerV2.boughtSeed:connect(func() player.sent("Seed received! Moving to plant...") droneV2.goto(10, 10) drone.plant(Enum.Seed.Wheat)end)🖱️ Interaction Events
Section titled “🖱️ Interaction Events”playerV2.clicked
Section titled “playerV2.clicked”Triggered when the player clicks in the world. Use this to create “manual override” commands for your drone.
lau-compiler.exe
playerV2.clicked:connect(func() print("[Input] Click detected! Performing flip...") drone.doFlip()end)OUTPUT:
[Input] Click detected! Performing flip...
💡 Practical Example: The Smart Auditor
Section titled “💡 Practical Example: The Smart Auditor”This script tracks your spending by alerting you every time you buy something.
playerV2.boughtGear:connect(func() varol balance = player.scrap() player.alert("Gear Purchased! Remaining Balance: " + balance)end)
playerV2.boughtSeed:connect(func() player.sent("New seeds in inventory. Ready for planting.")end)