Hey im new to making gmod servers and i am having trouble getting the playermodels to show up with their matterials not error signs. I dont knowif my coding is wrong but here are the lua files of one of the models i am using.
[CODE]ITEM.Name = 'Blades Player'
ITEM.Price = 250
ITEM.Model = 'models\blades_player.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
function ITEM:PlayerSetModel(ply)
ply:SetModel(self.Model)
end
[/CODE]
[CODE]if ( SERVER ) then
player_manager.AddValidModel( "Blades player", "models/blades_player.mdl" );
AddCSLuaFile( 'assassin.lua' ) ;
end
list.Set( "PlayerOptionsModel", "Blades player", "models/blades_player.mdl" );[/CODE]
This then shows up as error in agem please help.
Wrong section
bump
You haven't made players download the file via resource.addFile.
[QUOTE=code_gs;42663054]You haven't made players download the file via resource.addFile.[/QUOTE]
and how would i do that?
Create a lua file in lua/autorun/server with this code
[code]resource.AddFile("models\blades_player.mdl")[/code]
[QUOTE=code_gs;42664374]Create a lua file in lua/autorun/server with this code
[code]resource.AddFile("models\blades_player.mdl")[/code][/QUOTE]
i am doing it by using the work shop and it gets the adons but when i check points shop its still error. here is the code.
[CODE]@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started.
start /wait srcds.exe -console -game garrysmod +map ttt_minecraft_b5 +gamemode terrortown +maxplayers 24 -authkey removed +hot_workshop_collection 189637236
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds[/CODE]
[CODE]resource.AddWorkshop("170388692")
resource.AddWorkshop("181230176")[/CODE]
and yet skill errors.
This also comes up in the cmd upon starting.
[URL="http://gyazo.com/8e76842e5d98b61d70096be6d0a137ed"]http://gyazo.com/8e76842e5d98b61d70096be6d0a137ed[/URL]
Please help and thanks so far.
You spelled host wrong in +host_workshop_collection
[editline]27th October 2013[/editline]
You should really fix that lua error too
[QUOTE=code_gs;42664635]You spelled host wrong in +host_workshop_collection
[editline]27th October 2013[/editline]
You should really fix that lua error too[/QUOTE]
dont know how :S
[editline]27th October 2013[/editline]
Also still errors.
[editline]27th October 2013[/editline]
Maybe coded something wrong on both models?
[editline]27th October 2013[/editline]
[CODE]--[[
Feel free to use this Lua code for your own player models, sincerely nameguy (lol but if you can make your own player models you can probably code simple lua as well :P)
--]]
if (SERVER) then
player_manager.AddValidModel( "V", "models/V/v.mdl" ) -- replace "V" with the name of the player model, replace /V/v.mdl to the directory of your model
end
list.Set( "PlayerOptionsModel", "V", "models/V/v.mdl" ) -- replace "V" with the name of the player model, replace /V/v.mdl to the directory of your model[/CODE]
thats for the v auto run lua code. if it helps
Post your blades_player.lua file
[CODE]if ( SERVER ) then
player_manager.AddValidModel( "Blades player", "models/blades_player.mdl" );
AddCSLuaFile( 'assassin.lua' ) ;
end
list.Set( "PlayerOptionsModel", "Blades player", "models/blades_player.mdl" );[/CODE]
Delete the AddCsLua line
lemme try
[editline]27th October 2013[/editline]
Still error signs ;/ need the pointshop model lua code?
[editline]27th October 2013[/editline]
bump
Post your server .bat script again. Without the authkey obviously.
[CODE]@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started.
start /wait srcds.exe -console -game garrysmod +map ttt_minecraft_b5 +gamemode terrortown +maxplayers 24 -authkey +host_workshop_collection 189648780
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds[/CODE]
bump
Instead of using a "\" (Backward-slash), use a "/" (Forward-slash) when you specify the model in pointshop.
This:
[CODE]
ITEM.Model = 'models\blades_player.mdl'
[/CODE]
should be:
[CODE]
ITEM.Model = 'models/blades_player.mdl'
[/CODE]
Sorry, you need to Log In to post a reply to this thread.