Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· openaiHugging Face Suzhen/CodeChat

Fivem scripting LUA I'm currently using GetInteriorAtCoords is there anyway that i can…

  1. User

    Fivem scripting LUA I'm currently using GetInteriorAtCoords

    is there anyway that i can create the interior somewhere else?

  2. Assistant

    Yes, you can create the interior at a different location using CreateInterior and LoadInterior functions in your FiveM script. Here is a simple example using LUA:

    local interiorID -- Declare the variable to store the interior ID
    
    -- Creating and loading the interior
    Citizen.CreateThread(function()
        -- Call the CreateInterior function with the desired coordinates and the model hash of the interior
        interiorID = CreateInterior(vector3(xCoord, yCoord, zCoord), interiorModelHash)
    
        -- Check if the interior is valid
        if IsInteriorValid(interiorID) then
            -- Load the interior
            LoadInterior(interiorID)
    
            -- Wait for the interior to be loaded
            while not IsInteriorLoaded(interiorID) do
                Citizen.Wait(100)
            end
    
            -- Perform any additional tasks, such as enabling decorators, cap zones or security cameras
        end
    end)
    

    In this code snippet, replace xCoord, yCoord, and zCoord with the desired coordinates for the interior, and interiorModelHash with the interior model hash. You can find the model hash for different interiors in the game files or online resources like https://gta.fandom.com/wiki/Interiors.