Zum Inhalt

Lua Executor Snippets

⚠️ WARNING: These are malicious code snippets used by cheaters via Lua executors. This documentation exists to help developers understand and block these exploits.


Security Notice

These scripts represent common exploit patterns that: - Must be blocked server-side with proper validation - Should trigger anti-cheat systems when detected - Require server-side control for legitimate use cases

Never allow clients to execute these functions without server authorization!


Spawn Networked Vehicle

Exploit Pattern:

local ModelHash = "adder"
if not IsModelInCdimage(ModelHash) then return end
RequestModel(ModelHash)
while not HasModelLoaded(ModelHash) do
    Wait(0)
end
local MyPed = PlayerPedId()
local Vehicle = CreateVehicle(ModelHash, GetEntityCoords(MyPed), GetEntityHeading(MyPed), true, false)
SetModelAsNoLongerNeeded(ModelHash)

Protection: - Block client-side CreateVehicle for networked vehicles - Implement server-side vehicle spawning with permission checks - Monitor vehicle creation events and validate ownership


Spawn Explosion at Coords

Exploit Pattern:

local coords = GetEntityCoords(PlayerPedId())
local explosionType = 7  -- Car explosion
local damageScale = 1.0
local isAudible = false
local isInvisible = true
local cameraShake = 0.9

AddExplosion(coords.x + 2, coords.y + 2, coords.z, explosionType, damageScale, isAudible, isInvisible, cameraShake)

Explosion Types Reference

Type ID Description
DONTCARE -1 Any explosion
GRENADE 0 Hand grenade
GRENADELAUNCHER 1 Grenade launcher
STICKYBOMB 2 Sticky bomb
MOLOTOV 3 Molotov cocktail
ROCKET 4 Rocket launcher
TANKSHELL 5 Tank shell
HI_OCTANE 6 High octane
CAR 7 Car explosion
PLANE 8 Plane crash
PETROL_PUMP 9 Gas pump
BIKE 10 Motorcycle
DIR_STEAM 11 Directional steam
DIR_FLAME 12 Directional flame
DIR_WATER_HYDRANT 13 Water hydrant
DIR_GAS_CANISTER 14 Gas canister directional
BOAT 15 Boat explosion
SHIP_DESTROY 16 Ship destruction
TRUCK 17 Truck explosion
BULLET 18 Bullet impact
SMOKEGRENADELAUNCHER 19 Smoke grenade launcher
SMOKEGRENADE 20 Smoke grenade
BZGAS 21 BZ Gas
FLARE 22 Flare
GAS_CANISTER 23 Gas canister
EXTINGUISHER 24 Fire extinguisher
EXP_TAG_TRAIN 26 Train explosion
EXP_TAG_BARREL 27 Barrel explosion
EXP_TAG_PROPANE 28 Propane tank
EXP_TAG_BLIMP 29 Blimp explosion
EXP_TAG_DIR_FLAME_EXPLODE 30 Directional flame explosion
EXP_TAG_TANKER 31 Tanker explosion
PLANE_ROCKET 32 Plane rocket
EXP_TAG_VEHICLE_BULLET 33 Vehicle bullet
EXP_TAG_GAS_TANK 34 Gas tank
EXP_TAG_BIRD_CRAP 35 Bird crap
EXP_TAG_RAILGUN 36 Railgun
EXP_TAG_BLIMP2 37 Blimp 2
EXP_TAG_FIREWORK 38 Firework
EXP_TAG_SNOWBALL 39 Snowball
EXP_TAG_PROXMINE 40 Proximity mine
EXP_TAG_VALKYRIE_CANNON 41 Valkyrie cannon
EXP_TAG_AIR_DEFENCE 42 Air defense
EXP_TAG_PIPEBOMB 43 Pipe bomb
EXP_TAG_VEHICLEMINE 44 Vehicle mine
EXP_TAG_EXPLOSIVEAMMO 45 Explosive ammo
EXP_TAG_APCSHELL 46 APC shell
EXP_TAG_BOMB_CLUSTER 47 Cluster bomb
EXP_TAG_BOMB_GAS 48 Gas bomb
EXP_TAG_BOMB_INCENDIARY 49 Incendiary bomb
EXP_TAG_BOMB_STANDARD 50 Standard bomb
EXP_TAG_TORPEDO 51 Torpedo
EXP_TAG_TORPEDO_UNDERWATER 52 Underwater torpedo
EXP_TAG_BOMBUSHKA_CANNON 53 Bombushka cannon
EXP_TAG_BOMB_CLUSTER_SECONDARY 54 Cluster bomb secondary
EXP_TAG_HUNTER_BARRAGE 55 Hunter barrage
EXP_TAG_HUNTER_CANNON 56 Hunter cannon
EXP_TAG_ROGUE_CANNON 57 Rogue cannon
EXP_TAG_MINE_UNDERWATER 58 Underwater mine
EXP_TAG_ORBITAL_CANNON 59 Orbital cannon
EXP_TAG_BOMB_STANDARD_WIDE 60 Wide standard bomb
EXP_TAG_EXPLOSIVEAMMO_SHOTGUN 61 Explosive shotgun ammo
EXP_TAG_OPPRESSOR2_CANNON 62 Oppressor MK2 cannon
EXP_TAG_MORTAR_KINETIC 63 Kinetic mortar
EXP_TAG_VEHICLEMINE_KINETIC 64 Kinetic vehicle mine
EXP_TAG_VEHICLEMINE_EMP 65 EMP vehicle mine
EXP_TAG_VEHICLEMINE_SPIKE 66 Spike vehicle mine
EXP_TAG_VEHICLEMINE_SLICK 67 Slick vehicle mine
EXP_TAG_VEHICLEMINE_TAR 68 Tar vehicle mine
EXP_TAG_SCRIPT_DRONE 69 Script drone
EXP_TAG_RAYGUN 70 Ray gun
EXP_TAG_BURIEDMINE 71 Buried mine
EXP_TAG_SCRIPT_MISSILE 72 Script missile
EXP_TAG_RCTANK_ROCKET 73 RC tank rocket
EXP_TAG_BOMB_WATER 74 Water bomb
EXP_TAG_BOMB_WATER_SECONDARY 75 Secondary water bomb
EXP_TAG_FLASHGRENADE 78 Flash grenade
EXP_TAG_STUNGRENADE 79 Stun grenade
EXP_TAG_SCRIPT_MISSILE_LARGE 81 Large script missile
EXP_TAG_SUBMARINE_BIG 82 Large submarine explosion

Protection: - Monitor explosion events with AddEventHandler('explosionEvent', ...) - Validate explosion source and type server-side - Implement rate limiting for legitimate explosion events


Teleport Exploits

Exploit Pattern:

local waypoint = GetFirstBlipInfoId(8)
if DoesBlipExist(waypoint) then
    local coords = GetBlipCoords(waypoint)
    SetEntityCoords(PlayerPedId(), coords.x, coords.y, coords.z, false, false, false, true)
end

Protection: - Monitor player position changes with playerPosChanged events - Validate movement distances and trajectories - Implement server-side teleport validation


Ped Spawning

Exploit Pattern:

local ModelHash = "a_m_y_skater_01"
RequestModel(ModelHash)
while not HasModelLoaded(ModelHash) do Wait(0) end
local coords = GetEntityCoords(PlayerPedId())
local ped = CreatePed(4, ModelHash, coords.x + 2, coords.y, coords.z, 0.0, true, false)

Protection: - Monitor ped creation via entityCreating event - Whitelist allowed ped models per player - Validate ped ownership and purpose


Weapon Giving

Exploit Pattern:

local weaponHash = GetHashKey("WEAPON_PISTOL")
GiveWeaponToPed(PlayerPedId(), weaponHash, 250, false, true)

Protection: - Use server-side weapon management - Monitor weaponDamageEvent for unauthorized weapons - Implement weapon whitelist validation


God Mode / Invincibility

Exploit Pattern:

SetEntityInvincible(PlayerPedId(), true)
SetPlayerInvincible(PlayerId(), true)

Protection: - Monitor health changes and validate damage - Detect suspicious damage immunity patterns - Force health sync server-side


Vehicle Repair

Exploit Pattern:

local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
SetVehicleFixed(vehicle)
SetVehicleDeformationFixed(vehicle)

Protection: - Implement server-side vehicle repair system - Monitor vehicle health changes - Validate repair permissions


Weather/Time Manipulation

Exploit Pattern:

NetworkOverrideClockTime(12, 0, 0)
SetWeatherTypePersist("CLEAR")

Protection: - These are client-side only (don't affect other players) - Can be blocked by disabling natives if needed - Monitor for desync issues


Entity Deletion (Mass RDM)

Exploit Pattern:

local vehicles = GetGamePool('CVehicle')
for i = 1, #vehicles do
    DeleteEntity(vehicles[i])
end

Protection: - Monitor entityRemoved events - Validate entity ownership before deletion - Implement entity protection for shared vehicles


Noclip

Exploit Pattern:

SetEntityInvincible(ped, true)
SetEntityVisible(ped, false, false)
SetEntityCoords(ped, x, y, z, false, false, false, true)

Protection: - Monitor player position teleports - Detect flying/hovering patterns - Validate collision with world geometry


Anti-Cheat Implementation

Server-Side Event Monitoring

-- Block unauthorized vehicle spawning
AddEventHandler('entityCreating', function(entity)
    local entityType = GetEntityType(entity)
    local owner = NetworkGetEntityOwner(entity)

    if entityType == 2 then -- Vehicle
        -- Validate vehicle spawn permission
        if not HasSpawnPermission(owner) then
            CancelEvent()
        end
    end
end)

-- Monitor explosions
AddEventHandler('explosionEvent', function(sender, ev)
    -- Rate limit and validate explosion source
    if not IsExplosionAuthorized(sender, ev) then
        CancelEvent()
    end
end)

-- Protect against weapon exploits
AddEventHandler('weaponDamageEvent', function(sender, data)
    -- Validate weapon ownership
    if not PlayerHasWeapon(sender, data.weaponType) then
        CancelEvent()
    end
end)

Detection Patterns

  1. Rapid Entity Creation: Player creates multiple entities in short time
  2. Impossible Movement: Position changes exceeding vehicle/player speed limits
  3. Health Anomalies: Player takes no damage or heals instantly
  4. Resource Injection: Unauthorized client resources or scripts
  5. Network Manipulation: Packet injection or modification attempts

Legitimate Testing Use

For authorized development/testing: - Use these in offline/local servers only - Implement proper ACE permission checks - Always validate on server-side for production - Never execute directly from client in production environment

-- Example: Authorized admin command
RegisterCommand('adminspawn', function(source, args)
    if not IsPlayerAceAllowed(source, 'admin.spawn') then
        return
    end
    -- Safe server-side vehicle spawning
end, true) -- true = server-side only

Resources