Hats take too long to draw?

Ok, so I’ve been working on some hats, and I am having a problem.

When I make them, and then I wear them on SP they appear instantly or within a few seconds. (I use a PlayerSay hook to spawn them rather than ENT:SpawnFunction)

I upload them to my server, people type what they need to type to wear them, everything works, just sometimes it takes AGES to load, or it doesn’t load sometimes, and does other times.

I was wondering if there is any way to make the entity draw faster?

If it helps, my brother and I were playing in the same room, on the same Internet connection, we told our friend to wear a hat. He did everything correctly, when I saw the hat (after around 15 seconds) on my PC (which is a Duo Core laptop), he still didn’t see the hat until around 5 seconds later (he has a Quad Core Desktop). WTF much?

Help please.

Is this related to the hat maker addon? If so you should ask in it’s official thread : http://www.facepunch.com/showthread.php?t=767282

No, this is a variation of the Hats Pack LUA code (I basically just changed it from spawn menu to chatbox spawn)

I’m guessing you’re using networked variables to say when someone has a hat. Their updating isn’t always very reliable and can get flooded out by other things.

Networked Variables? Elaborate. Do you mean like SetNWInt/Bool/String and GetNWInt/Bool/String?

Also this: http://wiki.garrysmod.com/?title=ENT.UpdateTransmitState

If Networked Vars ARE the problem, could that fix it?

I hate it when I ask a question and hardly anyone replies Q_Q

People who answer feed on sample lua code and clear problems to solve.:smile:

This is true.

Meh, well I figured it out. It doesn’t use NWVars, but for some reason ENT:UpdateTransmitState made it load faster. Also instead of using an average model directory I used Model(“path/to/model.mdl”)

It loads around 5 times faster if not instant.