Making Pointshop Hats

Hello. i have a problem about modifyhat.

Its really hard to set up(modelscale,pos,position) with just speculation.

there is no other way to make(modify position hats) hats ?

anyone?

Get PAC. Put the model you want as a hat in your garrysmod/garrysmod/models. Start a singleplayer game, open the PAC menu and put the hat where you want it. Now copy all the angles and vectors somewhere, then put them in your lua file. Done.

Thanks , but have a problem.

ang:RotateAroundAxis(ang:Right(), 88.09) and Forward sutff.

What should i type the position instead of Angle(Pitch,Yaw,Roll) ?

In the script, there is ang:RotateAroundAxis(ang:Right(), 88.09) and stuff

[lua]
ITEM.Name = “Deerstalker”
ITEM.Enabled = true
ITEM.Description = “Gives you a Deerstalker.”
ITEM.Cost = 10000
ITEM.Model = “models/ttt/deerstalker.mdl”
ITEM.Attachment = “head”

ITEM.Functions = {
OnGive = function(ply, item)
ply:PS_AddHat(item)
end,

OnTake = function(ply, item)
	ply:PS_RemoveHat(item)
end,

ModifyHat = function(ent, pos, ang)
	ent:SetModelScale(Vector(1, 1, 1))
	pos = pos + (ang:Right() * 1.83) + (ang:Forward() * 0.12) + (ang:Up() * 1.83)
	ang:RotateAroundAxis(ang:Right(), 88.09) + ang:RotateAroundAxis(ang:Forward(), 90)
	return ent, pos, ang
end

}
[/lua]

Ouch… Then I don’t really know.

anyone?

anyone…?

anyone?

Why dont you just copy a similar hat and change it’s model? Maybe that will work.

Do your rotation before trying to figure out the position.



ang:RotateAroundAxis( ang:Right( ), 88.09 )
ang:RotateAroundAxis( ang:Forward( ), 90 )

pos = pos + ang:Right( ) * 1.83 + ang:Forward( ) * .12 + ang:Up( ) * 1.83

return ent, pos, ang

Not only does RotateAroundAxis not return anything, but you need to do the rotations before working with the angle object or the position will be wrong.

Thanks for reply.