I tried replacing the current melee weapon with a minecraft swep. but the textures show up as pink and black. I am pretty sure i placed all the files in the right place and set up the fast dl correctly. I used gmod extractor to extract the gma file and turned it into folders.
[url]http://steamcommunity.com/sharedfiles/filedetails/?id=136555165&searchtext=diamond+sword[/url]
Here is my lua for the sword
if SERVER then
AddCSLuaFile( "shared.lua" )
end
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_diamond_mc_sword.mdl"
SWEP.WorldModel = "models/weapons/w_diamond_mc_sword.mdl"
SWEP.HoldType = "melee"
if CLIENT then
SWEP.PrintName = "Diamond Minecraft Sword"
SWEP.Slot = 0
SWEP.Icon = "VGUI/ttt/icon_cbar"
SWEP.ViewModelFOV = 70
end
SWEP.FiresUnderwater = true
SWEP.base = "weapon_tttbase"
SWEP.Primary.Damage = 15
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Delay = 0.30
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.Delay = 2.5
SWEP.NoSights = true
SWEP.DrawCrosshair = false
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Kind = WEAPON_MELEE
SWEP.WeaponID = AMMO_CROWBAR
SWEP.InLoadoutFor = {ROLE_INNOCENT, ROLE_TRAITOR, ROLE_DETECTIVE}
local sound_single = Sound("Weapon_Crowbar.Single")
local sound_open = Sound("DoorHandles.Unlocked3")
if SERVER then
CreateConVar("ttt_crowbar_unlocks", "1", FCVAR_ARCHIVE)
CreateConVar("ttt_crowbar_pushforce", "420", FCVAR_NOTIFY)
end
I'm having some trouble with sweps as well but what you can try is adding resource.AddFile("materialpath") for all of the materials that came with the wep
[QUOTE=Aeternal;43208197]I'm having some trouble with sweps as well but what you can try is adding resource.AddFile("materialpath") for all of the materials that came with the wep[/QUOTE]
I added the mdl files into the resource.lua.
resource.AddFile( "models/weapons/v_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.mdl" )
[QUOTE=monstermega10;43214875]I added the mdl files into the resource.lua.
resource.AddFile( "models/weapons/v_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.mdl" )[/QUOTE]
You have to add the vmt files aswell.
Example: resource.AddFile("materials/weapons/weapon.vmt")
[QUOTE=Svenskunganka;43215271]You have to add the vmt files aswell.
Example: resource.AddFile("materials/weapons/weapon.vmt")[/QUOTE]
I thought that was the problem so i added it. But it still shows up as pink and black
resource.AddFile( "models/weapons/v_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.dx80.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.dx90.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.sw.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.vvd" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.dx80.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.dx90.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.phy" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.sw.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.vvd" )
[QUOTE=monstermega10;43215511]I thought that was the problem so i added it. But it still shows up as pink and black
resource.AddFile( "models/weapons/v_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.mdl" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.dx80.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.dx90.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.sw.vtx" )
resource.AddFile( "models/weapons/v_diamond_mc_sword.vvd" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.dx80.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.dx90.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.phy" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.sw.vtx" )
resource.AddFile( "models/weapons/w_diamond_mc_sword.vvd" )[/QUOTE]
That's not the materials. You're only adding the model.
I'll get you the correct code, sit tight.
the material files are the vmt's and vft's for the weapon