Logo Pastebin.fr
Pastebin

Retrouvez, créez et partagez vos snippets en temps réel.

GMOD

local Player = LocalPlayer()
local lastSwitchTime = 0
local switchCooldown = 0.2

local JutsuSets = {
    [1] = { -- MB4
        [1] = "nrp_eclair_charge",
        [2] = "nrp_hyoton_stuck",
        [3] = "nrp_katon_circle",
        [4] = "nrp_hyoton_dome",
        [5] = "nrp_kenjutsu_tranchant",
        [6] =  "nrp_kenjutsu_tempete",
    },
    [2] = { -- V
        [1] = "nrp_raiton_ball",
        [2] = "nrp_raiton_tiger",
        [3] = "nrp_raiton_pikebeam",
        [4] = "nrp_hyoton_dragon",
        [5] = "nrp_kenjutsu_fendoir",
        [6] = "nrp_katon_bigball",
    },
    [3] = { -- W
        [1] = "nrp_katon_tornado",
        [2] = "nrp_katon_breath",
        [3] = "nrp_raiton_raiton",
        [4] = "nrp_kenjutsu_souffle",
        [5] = "nrp_furie_frenesie",
        [6] = "nrp_guerrier_concentration",
    }
}

local function EquipSet(setID)
    local slots = JutsuSets[setID]
    if not slots then return end

    for slot, jutsu in pairs(slots) do
        if jutsu and jutsu ~= "" then
            net.Start("NRP.Jutsus:Equip")
            net.WriteUInt(slot, 3)
            net.WriteBool(true)
            net.WriteString(jutsu)
            net.SendToServer()

            if Player.getJutsusEquipped then
                Player:getJutsusEquipped()[slot] = jutsu
            end
        end
    end
end

hook.Add("PlayerButtonDown", "QuickEquipSets", function(ply, button)
    if ply ~= LocalPlayer() then return end

    local currentTime = CurTime()
    if currentTime - lastSwitchTime < switchCooldown then return end

    if button == MOUSE_4 then
        EquipSet(1)
        lastSwitchTime = currentTime
    elseif button == KEY_V then
        EquipSet(2)
        lastSwitchTime = currentTime
    elseif button == KEY_W then
        EquipSet(3)
        lastSwitchTime = currentTime
    end
end) 

Créé il y a 2 semaines.

Rechercher un Pastebin

Aucun paste trouvé.