Common Issues

This section is dedicated to addressing the most common issues you may face while setting up or using any of our scripts. We recommend carefully reading through the list of problems and their solutions to troubleshoot effectively and ensure everything runs smoothly.

Remember, a quick review of this section could save you time and prevent potential frustration. If you encounter a problem that isn't covered here or need additional help, please reach out via Discord at join our support server at Rainmad Scripts.

Casino Heist - Double Door or Door Does Not Open

If you're having issues with the doors in the Casino Heist, try stopping the bob74_ipl or fivem-ipl script and then test the heist again. If this fixes the problem, it means there's a conflict. You should remove the Casino IPL codes from your IPL script to avoid this issue in the future.

ESX - attempt to index a nil value (local 'player')

If you encounter the "attempt to index a nil value (local 'player')" error, follow these steps to resolve it:

  1. Open the server.lua file of the script where you encountered the error.

  2. Find the function call ESX.GetPlayers() or GetPlayers().

  3. Replace it with ESX.GetExtendedPlayers().

  4. Locate the following code:

for i = 1, #players do
    local player = ESX.GetPlayerFromId(players[i])
    for k, v in pairs(Config['CasinoHeist']['dispatchJobs']) do
        if player['job']['name'] == v then
            policeCount = policeCount + 1
        end
    end
end

Change it to:

for i = 1, #players do
    local player = players[i]
    for k, v in pairs(Config['CasinoHeist']['dispatchJobs']) do
        if player['job']['name'] == v then
            policeCount = policeCount + 1
        end
    end
end

Save and restart your server to apply the changes.

Humane Labs. Heist - Grill Cutting Not Working

Some users may encounter issues with grill cutting during the Humane Labs heist. The root cause of this problem is that the fingerpoint script continues to function while underwater. To resolve this issue, you can follow the steps below:

  1. Solution with Provided File: The easiest solution is to use the updated fingerpoint script provided by us. This file includes a condition that prevents the script from running underwater, automatically resolving the issue.

  2. Update Your Own Script: If you prefer to continue using your own fingerpoint script, you'll need to add a condition to prevent it from working while underwater:

    • Open your script file.

    • Add a check to ensure the script doesn't run when the player is underwater.

    • For example, you can use the IsPedSwimming function to check if the player is in water and stop the process accordingly.

Once these changes are made, the grill cutting issue during the Humane Labs heist should be resolved. Example:

local mp_pointing = false
local keyPressed = false

local function startPointing()
    local ped = GetPlayerPed(-1)
    if not IsPedSwimming(ped) then
        RequestAnimDict("anim@mp_point")
        while not HasAnimDictLoaded("anim@mp_point") do
            Wait(0)
        end
        SetPedCurrentWeaponVisible(ped, 0, 1, 1, 1)
        SetPedConfigFlag(ped, 36, 1)
        Citizen.InvokeNative(0x2D537BA194896636, ped, "task_mp_pointing", 0.5, 0, "anim@mp_point", 24)
        RemoveAnimDict("anim@mp_point")
    end
end

local function stopPointing()
    local ped = GetPlayerPed(-1)
    if not IsPedSwimming(ped) then
        Citizen.InvokeNative(0xD01015C7316AE176, ped, "Stop")
        if not IsPedInjured(ped) then
            ClearPedSecondaryTask(ped)
        end
        if not IsPedInAnyVehicle(ped, 1) then
            SetPedCurrentWeaponVisible(ped, 1, 1, 1, 1)
        end
        SetPedConfigFlag(ped, 36, 0)
        ClearPedSecondaryTask(PlayerPedId())
    end
end

local once = true
local oldval = false
local oldvalped = false

Citizen.CreateThread(function()
    while true do
        Wait(0)

        if once then
            once = false
        end

        if not keyPressed then
            if IsControlPressed(0, 29) and not mp_pointing and IsPedOnFoot(PlayerPedId()) then
                Wait(200)
                if not IsControlPressed(0, 29) then
                    keyPressed = true
                    startPointing()
                    mp_pointing = true
                else
                    keyPressed = true
                    while IsControlPressed(0, 29) do
                        Wait(50)
                    end
                end
            elseif (IsControlPressed(0, 29) and mp_pointing) or (not IsPedOnFoot(PlayerPedId()) and mp_pointing) then
                keyPressed = true
                mp_pointing = false
                stopPointing()
            end
        end

        if keyPressed then
            if not IsControlPressed(0, 29) then
                keyPressed = false
            end
        end
        if Citizen.InvokeNative(0x921CE12C489C4C41, PlayerPedId()) and not mp_pointing then
            stopPointing()
        end
        if Citizen.InvokeNative(0x921CE12C489C4C41, PlayerPedId()) then
            if not IsPedOnFoot(PlayerPedId()) and not IsPedSwimming(PlayerPedId()) then
                stopPointing()
            else
                local ped = GetPlayerPed(-1)
                local camPitch = GetGameplayCamRelativePitch()
                if camPitch < -70.0 then
                    camPitch = -70.0
                elseif camPitch > 42.0 then
                    camPitch = 42.0
                end
                camPitch = (camPitch + 70.0) / 112.0

                local camHeading = GetGameplayCamRelativeHeading()
                local cosCamHeading = Cos(camHeading)
                local sinCamHeading = Sin(camHeading)
                if camHeading < -180.0 then
                    camHeading = -180.0
                elseif camHeading > 180.0 then
                    camHeading = 180.0
                end
                camHeading = (camHeading + 180.0) / 360.0

                local blocked = 0
                local nn = 0

                local coords = GetOffsetFromEntityInWorldCoords(ped, (cosCamHeading * -0.2) - (sinCamHeading * (0.4 * camHeading + 0.3)), (sinCamHeading * -0.2) + (cosCamHeading * (0.4 * camHeading + 0.3)), 0.6)
                local ray = Cast_3dRayPointToPoint(coords.x, coords.y, coords.z - 0.2, coords.x, coords.y, coords.z + 0.2, 0.4, 95, ped, 7);
                nn,blocked,coords,coords = GetRaycastResult(ray)

                Citizen.InvokeNative(0xD5BB4025AE449A4E, ped, "Pitch", camPitch)
                Citizen.InvokeNative(0xD5BB4025AE449A4E, ped, "Heading", camHeading * -1.0 + 1.0)
                Citizen.InvokeNative(0xB0A6CFD2C69C1088, ped, "isBlocked", blocked)
                Citizen.InvokeNative(0xB0A6CFD2C69C1088, ped, "isFirstPerson", Citizen.InvokeNative(0xEE778F8C7E1142E2, Citizen.InvokeNative(0x19CAFA3C87F7C2FF)) == 4)

            end
        end
    end
end)
Van Heist - Enter/Exit Issue

If you're experiencing issues with entering or exiting the van during the Van Heist, you'll need to update the van's stream file. To resolve this issue:

  1. Download the Provided File: We have a file available for download that will fix the entry/exit problem.

  2. Update the Stream File: After downloading the file, update your van's stream file by replacing it with the one provided.

Once you've updated the stream file, the issue with entering and exiting the van during the heist should be resolved. Download Van File

Object Spawning Issues

If the objects in the script you've purchased are not spawning, there could be a couple of reasons for this:

  1. Anticheat Interference:

    • If you're using an anticheat, it might be blocking the objects from spawning. In this case, you'll need to whitelist the script within your anticheat configuration to allow the objects to spawn correctly.

  2. Other Scripts Deleting Objects:

    • If you don't have an anticheat and objects are still being deleted, it's likely that another script in your server is responsible for removing these objects. You'll need to check your server's scripts to identify which one might be deleting the objects and adjust its configuration or remove it if necessary.

By following these steps, you should be able to resolve any issues with objects not spawning in your purchased script.

Last updated