• Drawing SWEP + APCs
    0 replies, posted
  • Avatar of Entoros
  • Question 1: How would one going about making a SWEP that draws a rectangle from initial point to your eyetrace? Like, you click, it sets the intial point, then draws a rectangle based on wherever you're pointing to. Question 2: Why does spawning an APC/driver crash my gmod? [lua] npc:SetKeyValue("vehiclescript","scripts/vehicles/apc_npc.txt") npc:SetKeyValue("VehicleLocked","true") npc:SetKeyValue("model","models/combine_apc.mdl") npc:SetKeyValue("actionScale","1") npc:SetName( "Combine_apc" .. ply:SteamID() ) local driver = ents.Create("npc_apcdriver") if not pos or pos == nil then driver:SetPos(tr.HitPos+Vector(i*70,i*10,20)) else driver:SetPos(pos) end driver:SetHealth(driver:Health()+(ply:GetNWInt("LevelNum")-1)*20) driver:SetKeyValue( "vehicle", "Combine_apc" .. ply:SteamID() ) driver:SetName( "Combine_apc" .. ply:SteamID() .. "_driver" ) timer.Simple(30,function() if driver and driver:IsValid() then driver:Remove() end end) driver:Activate() driver:Spawn()[/lua]