Post: [Code ]EASY model spawner
05-28-2011, 01:26 AM #1
(adsbygoogle = window.adsbygoogle || []).push({});
    entity(location,model,angles,solid,linkit)
{
entity = spawn("script_model", location);
entity setModel( model );
entity.angles = angles;
if(model=="com_plasticcase_enemy" || model=="com_plasticcase_friendly")entity CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
if(solid==true)entity solid();
if(linkit==true)entity EnableLinkTo();
return entity;
}

Credit Me code
and lost for You must login or register to view this content.
ok so here is how to use it
    entity(<Location>,<Model Name>,<Angles>,<Solid>,<Enable Link>Winky Winky;

Now that is only if you want to create the model if you want to do stuff with it such as move it you will need to make it a variable and use it like this
    <variable Name>=entity(<Location>,<Model Name>,<Angles>,<Solid>,<Enable Link>Winky Winky;

and then to move it and do stuff to it you will need to use the variables name like this
    <Variable Name> MoveTo(self.origin+(40,10,53),2);
Or
<Variable Name> LinkTo(self);
And you can do anything else with it go look at the model manipulation thread above...

Examples :
Spawning:
    entity((x,y,z),"com_plasticcase_enemy",(0,0,0),true,true);
//X=Front & Back Y=Left & Right Z=Up & Down idk about angles though
Spawning and Using:
    model[1]=entity((x,y,z),"com_laptop_2_open",(14,0,0),false,true);

Moving:
    model[1] MoveTo((x,y,z),2);

Well you know the rest

Ohh and one more thing if you dont want to enable linking models simple dont put anything in for the last argument so that means leave <Enable Link> blank
and if you dont want the thing to be solid you can just leave it blank but if you want it not solid and to enable linking just put anything in there like abc for <solid> then true for <Enable link> It should work since abc or anything else doesnt do anything and it wont respond
Also give credit if you use it Smile
And dont flame please leave positive comments and suggestions I will be working on the code more to make it be more functional... Winky Winky
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo