Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add Weapon :/
#1
Sad 
Hello, it's 7 hours I try to add a new weapon someone can help me

Code:
local Item = QuickCreateItemTable(BaseWeapon, "weapon_axe_test", "Epée test", "TEST", "icons/weapon_axe")
Item = AddModel(Item, "models/props_canal/mattpipe.mdl", Vector(-0.6, 0.8, -5.9), Angle(4.7, 56.9, -176))
Item = AddStats(Item, 1, 1)
Item = AddSound(Item, "weapons/iceaxe/iceaxe_swing1.wav")
Item.Level = 1
Item.Weight = 1
Item.SellPrice = 1
Item.Dropable = false
Item.Giveable = false
Item.CanCutWood = true
Register.Item(Item)
The model is not displayed in the game
Reply
#2
Code:
Item = AddModel(Item, "models/props_canal/mattpipe.mdl", Vector(-0.6, 0.8, -5.9), Angle(4.7, 56.9, -176))
Is not used.

The models for items in Underdone are made using PAC3.
You can find that data in "garrysmod\gamemodes\underdone\gamemode\core\sharedfiles\database\models"
For example the Christmas hat data is

Code:
pac_luamodel["armor_helm_xmashat"] = {
[1] = {
    ["children"] = {
        [1] = {
            ["children"] = {
            },
            ["self"] = {
                ["Angles"] = Angle(-71.113586425781, 143.75730895996, 60.092720031738),
                ["UniqueID"] = "2843482023",
                ["ClassName"] = "model",
                ["Model"] = "models/player/items/all_class/oh_xmas_tree_demo.mdl",
                ["Position"] = Vector(2.28125, -2.24169921875, -1.5880432128906),
            },
        },
    },
    ["self"] = {
        ["EditorExpand"] = true,
        ["UniqueID"] = "3466398423",
        ["ClassName"] = "group",
        ["Name"] = "my outfit",
        ["Description"] = "add parts to me!",
    },
},
}

To edit this data in the PAC3 editor you need to save the following information to a .txt file in your pac3 data folder.
Install PAC3 to sandbox version of gmod.
Code:
[1] = {
    ["children"] = {
        [1] = {
            ["children"] = {
            },
            ["self"] = {
                ["Angles"] = Angle(-71.113586425781, 143.75730895996, 60.092720031738),
                ["UniqueID"] = "2843482023",
                ["ClassName"] = "model",
                ["Model"] = "models/player/items/all_class/oh_xmas_tree_demo.mdl",
                ["Position"] = Vector(2.28125, -2.24169921875, -1.5880432128906),
            },
        },
    },
    ["self"] = {
        ["EditorExpand"] = true,
        ["UniqueID"] = "3466398423",
        ["ClassName"] = "group",
        ["Name"] = "my outfit",
        ["Description"] = "add parts to me!",
    },
},

As you can see the first line and the last closing bracket of the original code is used in UD only, this tells the game mode that the item called "armor_helm_xmashat" will use that PAC3 data.

I have rushed this post, but I am sure it will give you some insight at least.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)