So i try to add player models to my server, but they never work. here are the steps i follow:
1st) extract model from .gba file
2nd) create .lua in models\player\"name of file".lua
Do this by putting the following in above location lua:
[CODE]if (SERVER) then
player_manager.AddValidModel( "Model Name Goes Here", "Model File Location Goes Here" )
AddCSLuaFile( "CallThisAnything.lua" )
end
list.Set( "PlayerOptionsModel", "Model Name Goes Here", "Model Location Goes Here" )[/CODE]
and add player textures under it.
3rd) then i make the resource.AddFile( "location of file" ) under lua/autorun/server
4th) make pointshop code
[CODE]ITEM.Name = 'Model Name Goes here'
ITEM.Price = 250
ITEM.Model = 'Model File Location Goes Here'
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]
4th) add edited extracted model into addon folder for server
5th) run server and get lua error for not having an item in the pointshop... not even the addon folder, but the in the pointshop. once i delete the item in pointshop, error stops.
I am following all of the above steps exactly. In the commands, there are somethings that say like "Put name here" and i dont always make them the same. tell me which ones should be the same and everything because this never seems to work...
If you are downloading the addon from workshop, you don't need to extract it, download it to your server from workshop, and use resource.AddWorkshop.
As for your problem,
1) You are creating the .lua file in the wrong place. models/ folder is for models only.
2) You don't need first code for pointshop, only for sandbox.
Oh, sorry, my bad. I didnt mean to put that! i meant to put "name of player model"\lua\autorun i dont know why i put the other one =/ and so the entire first code is obsolete for anything but sandbox?
Sorry, you need to Log In to post a reply to this thread.