point shop

Post Reply
wryxian
New to forums
New to forums
Posts: 1
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Oct 16, 2013 4:49 pm

point shop

Post by wryxian »

ok i have been looking on the forums for help on this and well basicly im being retarded, i got a TTT server got point shop working all good now i downloaded some models and i want to install them so i moved the lua file of the model to the point shop and now i get lua errors people say you need to use this code and this code to fix it but i have no idea what or how they mean at all

any one able to help or just do a simple stop by stop for me :)

thanks
User avatar
ThatGuyNex
This is my homepage
This is my homepage
Posts: 239
Joined: Tue May 28, 2013 12:23 pm

Re: point shop

Post by ThatGuyNex »

This is actually fairly simple. You just need to create a new lua file in "garrysmod/lua/items/playermodels" with this content:

Code: Select all

ITEM.Name = 'Faith'
ITEM.Price = 9999
ITEM.Model = 'models/player/something.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
Switch out the price/name/model path with your own values, make sure there are no spaces or special characters in the file name, change the map and the model should appear in your Pointshop menu.
Post Reply