• Making Pointshop Hats
    10 replies, posted
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.
[QUOTE=MuffinZerg;31385777]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.[/QUOTE] 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]
[QUOTE=cyw960517;31386647]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][/QUOTE] 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. [code] 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[/code] 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.
[QUOTE=Kogitsune;31502148]Do your rotation before trying to figure out the position. [code] 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[/code] 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.[/QUOTE] Thanks for reply.
Sorry, you need to Log In to post a reply to this thread.