• script to precache SWEPs?
    4 replies, posted
I've never written a script before, but I've been told that there is a way to precache SWEPs so that they don't lag when you spawn them the first time. How would you go about doing this?
you precache the models and textures used by the swep.
Well the thing is that I have no idea how to write a script.
Here's what I use [code] hook.Add( "Initialize", "rb655_precache", function() for id, wep in pairs( weapons.GetList() ) do util.PrecacheModel( wep.ViewModel or "" ) util.PrecacheModel( wep.WorldModel or "" ) end end )[/code] This may, or may not help.
[QUOTE=Robotboy655;43812094]Here's what I use [code] hook.Add( "Initialize", "rb655_precache", function() for id, wep in pairs( weapons.GetList() ) do util.PrecacheModel( wep.ViewModel or "" ) util.PrecacheModel( wep.WorldModel or "" ) end end )[/code] This may, or may not help.[/QUOTE] I'll definitely check this out when I get home.
Sorry, you need to Log In to post a reply to this thread.