Thug Studios
TEBEXYOUTUBEDISCORD
  • ๐Ÿ“„Welcome
  • INFORMATION
    • ๐Ÿ“งFind Transaction ID
    • ๐Ÿ“ฆTebex Script Integration
    • ๐Ÿ”‘CFX Auth System
    • ๐Ÿ”“Escrow/Open Source
    • ๐Ÿ”—Get Steam Api Key
    • ๐ŸงพGet Player License
  • SCRIPTS
    • ๐Ÿ’›RP Series
      • ๐Ÿ“ฆThug Crafting
        • Installation
        • Shared/settings.lua
        • Shared/crafting_items.lua
        • Shared/levels.lua
        • Shared/locale.lua
        • Shared/notify.lua
        • Shared/debug.lua
      • ๐Ÿ“ฆThug Dispatch
        • Installation
        • Shared/settings.lua
        • Shared/alerts.lua
        • Shared/zones.lua
        • Shared/weapons.lua
        • Shared/locale.lua
        • Shared/notify.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug RPS
        • Installation
        • Configuration
        • Translate
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Keyword
        • Installation
        • Configuration
        • Translate
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Hour Prizes
        • Installation
        • Configuration
        • No_Escrow
        • Ready Notify.lua
      • ๐Ÿ“ฆThug Anti Mods
        • Installation
        • Configuration
        • Translate
        • Ready Notify.lua
    • ๐Ÿ’šPVP Series
      • ๐Ÿ“ฆThug PVP Hud V3
        • Installation
        • Configuration
        • Translate
        • Shared/weapons.lua
        • Shared/zones.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Deathcam
        • Installation
        • Configuration
        • Translate
        • Ready Notify.lua
        • Shared/weapons.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Killfeed V2
        • Installation
        • Configuration
        • Translate
        • Shared/weapons.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Kill Shows
        • Installation
        • Configuration
        • Translate
        • Client/no_escrow.lua
Powered by GitBook
On this page
  1. SCRIPTS
  2. N Series
  3. Thug N Multichracter (FREE)

Functions.lua

-- | # For help with this script: https://discord.gg/thugstudios
-- | # For more free scripts: https://discord.gg/thugstudios
-- | # For the best quality scripts: https://discord.gg/thugstudios

-- | # This section allows you to fetch the model when your character spawns.
Load_Model = function(model_name)
    local model = GetHashKey(model_name)
    RequestModel(model)
    while not HasModelLoaded(model) do
        Citizen.Wait(100)
    end
    SetPlayerModel(PlayerId(), model)
    Citizen.Wait(100)
    local new_ped = PlayerPedId()
    SetPedComponentVariation(new_ped, 0, 0, 0, 2)
end

-- | # This function is used after a player creates a character for the first time.
First_Character_Spawn = function(gender)
    local ply_ped = PlayerPedId()
    local default_model = "mp_m_freemode_01"
    if gender == 1 then
        default_model = "mp_f_freemode_01"
    end
    Load_Model(default_model)
    Wait(500)
    if Config.Settings['Clothing_Script'] == 'illenium-appearance' then
        if Config.Settings['Framework'] == "qb" or Config.Settings['Framework'] == "old-qb" then
            TriggerEvent('qb-clothes:client:CreateFirstCharacter')
        else
            TriggerEvent('esx_skin:openSaveableMenu', function()
                finished = true
            end, function()
                finished = true
            end)
        end
    elseif Config.Settings['Clothing_Script'] == 'qb-clothing' then
        TriggerEvent('qb-clothes:client:CreateFirstCharacter')
    end
    -- | # If you have something to add, you can add it here.
    -- | # If you are using apartments you can add the spawn event here.
end

-- | # This function is used after a player spawns.
Default_Spawn = function(data)
    Load_Model(data.model)
    Wait(1000)
    if Config.Settings['Clothing_Script'] == 'illenium-appearance' then
        exports['illenium-appearance']:setPedAppearance(PlayerPedId(), json.decode(data.skin))
    elseif Config.Settings['Clothing_Script'] == 'qb-clothing' then
        TriggerEvent('qb-clothing:client:loadPlayerClothing', data.skin, PlayerPedId())
    end
    -- | # If you have something to add, you can add it here.
end

-- | #  This function is used before opening the Multicharacter menu.
Before_The_Menu = function()
    ShutdownLoadingScreen()
    ShutdownLoadingScreenNui()
    if Config.Settings['Framework'] == 'esx' then
        TriggerEvent("esx:loadingScreenOff")
    end
    -- | # If you have something to add, you can add it here.
end

-- | #  This function is used after closing the Multicharacter menu.
After_The_Menu = function(firstspawn)
    if Config.Settings['N_Spawn_Selector'] and not firstspawn then
        TriggerEvent('n-spawn-selector-v2:client:open', firstspawn)
    end
    if Config.Settings['QB_Weathersync'] then
        TriggerEvent('qb-weathersync:client:EnableSync')
    end
    -- | # If you have something to add, you can add it here.
    -- | # If you are using spawnselector you can add the spawn event here.
end

Last updated 3 months ago

๐Ÿฉต
๐Ÿ“ฆ