Lua API Reference
AstraClient features a robust Lua Executor engine that allows you to write custom scripts. This reference covers the global functions exposed to your scripts.
Advanced Users Only: Executing untrusted Lua scripts can be dangerous. Only run scripts you have written yourself or obtained from trusted sources within the AstraClient community.
Player Functions
GetLocalPlayer()
Returns the local player entity ID.
local myPlayer = GetLocalPlayer()
print("My Player ID is: " .. myPlayer)
SetPlayerHealth(entity, health)
Sets the health of the specified entity.
local myPlayer = GetLocalPlayer()
-- Set health to max (200)
SetPlayerHealth(myPlayer, 200)
Vehicle Functions
SpawnVehicle(modelName)
Spawns a vehicle by its model name at your current location and places you in the driver's seat.
-- Spawn a T20 super car
local myCar = SpawnVehicle("t20")
SetVehicleHandling(entity, multiplier)
Modifies the handling and speed multiplier of the specified vehicle.
local myCar = GetVehiclePedIsIn(GetLocalPlayer(), false)
if myCar ~= 0 then
-- Double the speed and handling
SetVehicleHandling(myCar, 2.0)
end
UI Functions
ShowNotification(message)
Displays a custom notification in the bottom left corner of the screen.
ShowNotification("Custom Lua Script Loaded Successfully!")