Okay guys.
How do I make so I can make a hat addon? I just need a spawn system, I got this but its not working :(
bone = self:LookupBone("ValveBiped.Bip01_Head1");
pos, ang = self:GetBonePosition(bone)
local hatTable = HAT_DATABASE[1]
local enthat = ents.Create("prop_physics")
enthat:SetModel(hatTable.model)
enthat:SetPos(pos)
enthat:SetAngles(ang)
enthat:Spawn() after all that.
[QUOTE=danielga;37933125]enthat:Spawn() after all that.[/QUOTE]
Hehe yeah okay ;) Before when I tryed some other things i did not need the enthat:Spawn() :p
[editline]6th October 2012[/editline]
[QUOTE=danielga;37933125]enthat:Spawn() after all that.[/QUOTE]
Hehe yeah okay ;) Before when I tryed some other things i did not need the enthat:Spawn() :p
[editline]6th October 2012[/editline]
No they spawn and flys of the head -.-
enthat:SetParent(self)
[QUOTE=Matt W;37939097]enthat:SetParent(self)[/QUOTE]
Then its parrent to the mid..
[QUOTE=flambert;37939290]Then its parrent to the mid..[/QUOTE]
Try parenting it to the bone, Don't know if it will work but try it.
Logic says it should be parented to the head bone if it has to work right.
Nah don't work, its just spawning and flying of the head:
local enthat = ents.Create("prop_physics")
enthat:SetModel(hatTable.model)
enthat:SetPos(pos)
enthat:SetAngles(ang)
enthat:SetParent(bone)
enthat:Spawn()
I got a local bone = the head bone :)
[URL="http://glua.me/search/?keywords=PostPlayerDraw"][IMG]http://glua.me/search.png[/IMG] [B]PostPlayerDraw[/B][/URL]
[URL="http://glua.me/search/?keywords=ClientsideModel"][IMG]http://glua.me/search.png[/IMG] [B]ClientsideModel[/B][/URL]
The pointshop on Garrysmod.org has a good example on how to use the PPD method, from line 275 to 306.
Sorry, you need to Log In to post a reply to this thread.