Hey guys. I have a server I am trying to add playermodels that admins and donators can use but I keep getting errors in the game when I try it. The server is running ttt btw. These are the codes and the locations of the codes for this particular model. Also if you could just point out what is wrong so I can get the code right for the rest of the models I put on that would be great. Thanks a lot for the help.
file 1:
/garrysmod/addons/Lich King Model and PLAYERMODEL/lua/autorun/lich_king_model_wow_playermodel.lua
[CODE]local function AddPlayerModel( name, model )
list.Set( "PlayerOptionsModel", name, model )
player_manager.AddValidModel( name, model )
player_manager.AddValidHands( name, model, skin, body )
end
list.Set( "PlayerOptionsModel", "ArthasLichKing", "models/player/Lich_King_WoW_masked.mdl" )
player_manager.AddValidHands( "ArthasLichKing", "models/weapons/c_arms_lich_king_wow.mdl", 0, "0000000" )
if (SERVER) then
player_manager.AddValidModel( "ArthasLichKing", "models/player/Lich_King_WoW_masked.mdl" )
AddCSLuaFile( "arthas.lua" )
end
list.Set( "PlayerOptionsModel", "ArthasLichKing", "models/player/Lich_King_WoW_masked.mdl" )
--// File Generated By Fox-Warrior's Resources Generator Version 2.05 \\--
if (SERVER) then
resource.AddSingleFile( "models/weapons/c_arms_lich_king_wow.mdl" )
resource.AddSingleFile( "models/player/lich_king_wow_masked.mdl" )
// resource.AddSingleFile( "models/player/lich_king_wow_maskless.mdl" )
resource.AddSingleFile( "models/maxxy/lich_king_enhanced/arthas_helmet.mdl" )
resource.AddSingleFile( "models/maxxy/lich_king_enhanced/arthas_sword.mdl" )
resource.AddSingleFile( "models/maxxy/lich_king_enhanced/arthas_the_lich_king.mdl" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/arthas_sword.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/beam_eye_left.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/beam_eye_right.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/fire_blue.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/fire_blue_b.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_1.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_1.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_1exp.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_1n.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_2.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_2.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_2exp.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_2n.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_face.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_head.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/lich_king_lightwarp.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/smoke_eye.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/smoke_eye_bg.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword_detail.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword_detail.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword_detail_2.vmt" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword_detail_bg.vtf" )
resource.AddSingleFile( "materials/models/maxxy/lich_king_enhanced/sword_n.vtf" )
end[/CODE]
file 2:
/garrysmod/addons/pointshop/lua/items/Donator/arthas.lua
[CODE]ITEM.Name = 'Lich King'
ITEM.Price = 250
ITEM.Model = 'models/player/Lich_King_WoW_masked.mdl'
function ITEM:OnEquip(ply, modifications)
if not ply._OldModel then
ply._OldModel = ply:GetModel()
end
timer.Simple(1, function() ply:SetModel(self.Model) end)
end
function ITEM:OnHolster(ply)
if ply._OldModel then
ply:SetModel(ply._OldModel)
end
end
[/CODE]
Remove ALL UPPERCASE charatets and spaces from your files and folders, and move the materials and models on your server to root folder instead of addons/
ok ill do that and let you know how it goes
[editline]25th September 2013[/editline]
its still not working. this is the error I am getting in the logs
L 09/25/2013 - 16:32:19: Lua Error: [AddCSLuaFile] Couldn't find 'arthas.lua' (@addons/lich king model and playermodel/lua/autorun/lich_king_wow_playermodel.lua (line 14))
[editline]25th September 2013[/editline]
I am wondering is the lua file it is referring to in the right spot?
Sorry, you need to Log In to post a reply to this thread.