Help with Workshop and Playermodels in Pointshop

Hello, i am now to GMOD Lua Scripting… It’s my first time that i am an Admin on a server.

Now, i want to download playermodels via workshop and add them to the workshop

What i did:

under lua/autorun/servers i created a lua file named “workshop.lua”
in workshop lua is the code:


resource.AddWorkshop("157420728")
resource.AddWorkshop("216408135")
resource.AddWorkshop("156993924")
resource.AddWorkshop("156924206")
resource.AddWorkShop("157873654")
resource.AddWorkShop("156923320")
resource.AddWorkShop("157854748")


this is for downloading my playermodels and maps

now i extracted the .GMAs with GMADConverter and put the folders into addons.

i went to addons/pointshop-master/lua/items/playermodels and wrote


ITEM.Name = 'Woody'
ITEM.Price = 15000
ITEM.Model = 'models/player/woody.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

but… it WON’T work!!! Im so confused right now

i hope you can understand and help me :confused:

Regards

What won’t work? Are they errors? Do they not show up? Are the models on your server as well?

ops, im sorry that i didn’t tell you about the error

The error is: that another players can’t see the models, it shows as an error up.

Regards

Here’s your issue:

You don’t want to do that if you want to use resource.AddWorkshop. You use host_workshop_collection_id right?

Alright, i delete soon the folders but i don’t know what i should type in host_workshop_Collection_id
i only typed the workshop id, like from woody “12345678”

Screen:
////

No you want to type the ID of your collection.

Read more here.

By the way, remove that picture from the post as it contains your actualy Steam Web API key, and you don’t want to share that.

does that work for Hosted servers like www.nitrado.de ?

Yes

Thanks i will test it out!!!

[editline]3rd February 2014[/editline]

Sorry for doubleposting, but i dont understand it,

he say in this video at 4:20

to create a shotcut, what should i do? i have a webinterface …

Regards ~

EDIT: It don’t work! :confused:

Omg…

  1. Create a collection of your addons on the workshop.
  2. Get the ID of the collection.
  3. Add the ID along with your Steam API key to your web-interface.
  4. Profit??
  1. Done
  2. Done http://prntscr.com/2p9dyy <— see this
  3. Done
  4. i cant

my WS Collection: http://steamcommunity.com/sharedfiles/filedetails/?id=224127664

Not sure if it matters but knowing coding it probably does, did you try renaming it to “Workshop.lua” instead of “workshop.lua”

The name doesn’t matter, as long as it’s in /lua/autorun or /lua/autorun/server depending on the if statement.

You are free to post solutions if you actually know what you’re talking about.

He added me yesterday and I helped him get it working. I think this is solved.