Examples¶
Real, copy-paste scripts built only from the Asterion
API and standard FiveM natives. Paste any of them into the console and run.
Damage one player¶
Damage everyone nearby¶
Godmode (loop)¶
Top the local ped's health up several times a second, then stop it on demand.
local god = Asterion.Thread([[
local ped = PlayerPedId()
SetEntityHealth(ped, GetEntityMaxHealth(ped))
ClearPedBloodDamage(ped)
]], 200)
-- later:
-- Asterion.StopThread(god)
Infinite stamina & no ragdoll¶
Asterion.Thread([[
local ped = PlayerPedId()
RestorePlayerStamina(PlayerId(), 1.0)
SetPedCanRagdoll(ped, false)
]], 300)
Teleport to waypoint¶
Teleports need a real game thread, so run them through
Isolated.
Asterion.Isolated([[
Citizen.CreateThread(function()
local blip = GetFirstBlipInfoId(8)
if not DoesBlipExist(blip) then return end
local c = GetBlipInfoIdCoord(blip)
local ped = PlayerPedId()
for z = 0, 1000, 25 do
SetEntityCoords(ped, c.x, c.y, z + 0.0, false, false, false, false)
Citizen.Wait(0)
local found, gz = GetGroundZFor_3dCoord(c.x, c.y, z + 0.0, false)
if found then
SetEntityCoords(ped, c.x, c.y, gz + 1.0, false, false, false, false)
break
end
end
end)
]])
Target a dynamic player in a thread¶
The thread body is a string, so build it with format to pass a value in.
local target = 7
Asterion.Thread(([[
Asterion.SendDamage({ player = %d, damage = 1000.0 })
]]):format(target), 500)
ESX: set your money¶
vRP: close the menu (anti-spoof safe)¶
Read a resource's state once¶
Hide a HUD element (NUI)¶
Cleanup
Started a few loops while testing? Stop every one of them at once with a
bare Asterion.StopThread().