• Is there a way to freeze all default map props when the server starts?
    7 replies, posted
I have this map gm_underground_iv_fix and all the props it spawnes with you can pick them up or move them. I there any lua code that freezes the default map props when the server starts up? Thanks in advance Jeromy Han
My guess: [code] hook.Add( "InitPostEntity", "FreezePropPhysics", function() for Key, Entity in pairs( ents.FindByClass( "prop_physics" ) ) do local PhysicsObject = Entity:GetPhysicsObject() if ( IsValid( PhysicsObject ) ) then PhysicsObject:EnableMotion( false ) end end end ) [/code] Untested
[QUOTE=McDunkable;49868947]My guess: [code] hook.Add( "InitPostEntity", "FreezePropPhysics", function() for Key, Entity in pairs( ents.FindByClass( "prop_physics" ) ) do local PhysicsObject = Entity:GetPhysicsObject() if ( IsValid( PhysicsObject ) ) then PhysicsObject:EnableMotion( false ) end end end ) [/code] Untested[/QUOTE] and place that in lua/autorun/server in a file named whatever you want.
[QUOTE=AustinH;49869075]and place that in lua/autorun/server in a file named whatever you want.[/QUOTE] He probably doesn't need THAT much spoonfeeding You might also want to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/CreatedByMap]Entity:CreatedByMap[/url]
[QUOTE=MPan1;49869669]He probably doesn't need THAT much spoonfeeding You might also want to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/CreatedByMap]Entity:CreatedByMap[/url][/QUOTE] I used to help people with DarkRP servers... I'm used to people not knowing what an FTP is.
[QUOTE=AustinH;49870615]I used to help people with DarkRP servers... I'm used to people not knowing what an FTP is.[/QUOTE] [B]I[/B] don't even know what an FTP is, but okay then...
[QUOTE=MPan1;49870632][B]I[/B] don't even know what an FTP is, but okay then...[/QUOTE] wat
Thank you everyone the code works but somehow it messes with the doorgroups they just get deleted
Sorry, you need to Log In to post a reply to this thread.