Thread: lua chams

Results 1 to 3 of 3
  1. #1
    KMH512's Avatar
    Join Date
    Nov 2015
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    My Mood
    Aggressive

    Question lua chams

    I didnt want to necro any old threads so I decided I would make a new one Im trying to figure out how to make lua chams where if you can see a player they are one color but if you cant see them they're a different color.

  2. #2
    ethanop7's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    0
    Code:
    local R = debug.getregistry();
    
    local VectorConversion = function(rgb) local tbl = rgb; for k,v in next, tbl do tbl[k] = v / 255; end return tbl; end
    local chamsmat = CreateMaterial("debugwhite", "VertexLitGeneric", 
    {["$ignorez"] = 1,["$model"] = 1,["$basetexture"] = "models/debug/debugwhite",});
    local chamsmat2 = CreateMaterial("debugwhite2", "VertexLitGeneric", 
    {["$ignorez"] = 0,["$model"] = 1,["$basetexture"] = "models/debug/debugwhite",});
    
    local function Chams ()
    	if(features["chams"]) then
    	for k,v in next, player.GetAll() do	
    		if(R.Entity.Health(v) < 1 || v == LocalPlayer() || !R.Entity.IsValid(v) || v:IsDormant()) then continue; end 
    		local pColorVis = VectorConversion(Color(256, 0, 256));
    		local pColor = VectorConversion(Color(128, 0, 128));
    		local pColorGun = VectorConversion(Color(40, 40, 40));
    		cam.Start3D();
    			render.MaterialOverride(chamsmat);
    			render.SetColorModulation(pColorVis.r,pColorVis.g,pColorVis.b);
    			render.SetBlend(1);
    			R.Entity.DrawModel(v);
    			
    			if (R.Entity.IsValid(R.Player.GetActiveWeapon(v))) then
    				render.SetColorModulation(pColorGun.r,pColorGun.g,pColorGun.b);
    				R.Entity.DrawModel(R.Player.GetActiveWeapon(v));
    			end
    			
    							
    			render.SetColorModulation(pColor.r,pColor.g,pColor.b);
    			render.MaterialOverride(chamsmat2);
    			render.SetBlend(1);
    							
    			R.Entity.DrawModel(v);
    			
    			if (R.Entity.IsValid(R.Player.GetActiveWeapon(v))) then
    				render.SetColorModulation(pColorGun.r,pColorGun.g,pColorGun.b);
    				R.Entity.DrawModel(R.Player.GetActiveWeapon(v));
    			end
    			render.SetColorModulation(1, 1, 1);
    
    		cam.End3D();
    	end
    	end
    end
    
    local function HUDPaint()
    	Chams();
    end
    
    hook.Add("HUDPaint", "", HUDPaint);
    yup yup features["chams"] just refers to the features table i have for all of my features booleans (convars are shit!!1), add any check there for your convar or whatever the fuck ur using

    change the rgb values in the three variables (pColorVis, pColor, and pColorGun) to change the color
    Last edited by ethanop7; 06-04-2019 at 04:02 PM.

  3. #3
    Shaar_'s Avatar
    Join Date
    Jun 2019
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    My Mood
    Blah
    v:IsDormant() -> R.Entity.IsDormant(v)

Similar Threads

  1. [Solved] LUA Garry's Mod making a Chams ESP
    By OMGOMG1322 in forum Garry's Mod Server Exploits & Help
    Replies: 3
    Last Post: 09-16-2015, 03:32 PM
  2. [Help Request] Lua Chams
    By Trollaux in forum Garry's Mod Discussions & Help
    Replies: 6
    Last Post: 01-25-2014, 11:41 AM
  3. ESP/Chams For BHD 1.5.0.5 Arugs 1.2m: Undetected
    By sf0d in forum General Game Hacking
    Replies: 1
    Last Post: 11-05-2008, 02:31 PM
  4. Chams!
    By Underglow450 in forum WarRock - International Hacks
    Replies: 50
    Last Post: 03-17-2007, 05:19 AM
  5. America's Army No Recoil/Reload LUA code.
    By MagikBullet in forum General Game Hacking
    Replies: 7
    Last Post: 02-25-2007, 10:11 AM