• Need Help With Spawning Sweps With LUA
    3 replies, posted
In the gamemode I'm working on, I'm trying to spawn certain custom sweps (the CS ones listed below) like I would with any entity or swep, but for some reason it just spawns an intangible model, unlike the others I'm spawning which work fine. Here is the code I'm using: [LUA]function GM:InitPostEntity( ) Entity=ents.Create("weapon_real_cs_scout") Entity:SetPos(Vector(713.437927,137.468307,48.521030)) Entity:Spawn() Entity=ents.Create("weapon_real_cs_glock18") Entity:SetPos(Vector(-711.407532,278.088837,71.113228)) Entity:Spawn() Entity=ents.Create("item_ammo_pistol") Entity:SetPos(Vector(616.677856,217.421722,70.8783260)) Entity:Spawn() Entity=ents.Create("weapon_medkit") Entity:SetPos(Vector(613.530151,114.322144,90.514229)) Entity:Spawn() end[/LUA]
perhaps you need to set collision group and wake the physics object? Source can be quite iffy about stuff like that.
Are you sure those entities are defined and are not throwing errors? You should check the code inside those entities.
[QUOTE=BFG9000;42816314]perhaps you need to set collision group and wake the physics object? Source can be quite iffy about stuff like that.[/QUOTE] Okay I woke the entities. It works fine now. Thanks!
Sorry, you need to Log In to post a reply to this thread.