• Command to get all spawned entties of type.
    0 replies, posted
Hey im using the slasher gamemode and they using for spawning the entities that formatting: [CODE]Generator = { {type="sls_generator", pos=Vector( -230.557007, 567.435425, 0.243941 ), ang=Angle( -0.104, 179.841, 0.022 ),spw=false,}, {type="sls_generator", pos=Vector( -3185.97,1998.87,-255.78 ), ang=Angle( -0.082,-88.412,-0.005 ),spw=false,}, {type="sls_generator", pos=Vector( 1631.988892, 3082.173340, -39.728069 ), ang=Angle( -0.082, 89.379, 0.005 ),spw=false,}, },[/CODE] This code is not automatic generated its copy paste and checking the entity coordinates.. How is a formatting like this possible? [CODE]for k, v in pairs( ents.FindByClass( "item_ammo_357" ) ) do Ammo[k] = {type=v:GetClass(), pos=Vector(v:GetPos()), ang=Angle(v:GetAngles()), spw=false } end local str = util.TableToJSON(Ammo) file.Write( "slasherentities.txt", str )[/CODE] The code output is: [CODE][{"type":"item_ammo_357","pos":"[740.8759 340.879 -143.5764]","spw":false,"ang":"{1.0209 -0.0286 -0.6623}"},[/CODE] but for copy paste the right formatting into the lua for slasher i need to make the formatting like the upper example.. I know JSON to TABLE could help but idk how to use it properly thanks alot. THE GITHUB REPO [URL="https://github.com/Garrus2142/Slashers/"]https://github.com/Garrus2142/Slashers/[/URL]
Sorry, you need to Log In to post a reply to this thread.