Solved❓ LUA Garry's Mod making a Chams ESP

Posts 1–4 of 4 · Page 1 of 1
❓ LUA Garry's Mod making a Chams ESP
So, as the title says. I want to make a chams ESP script, and I have looked at other codes for examples to try to learn but I couldn't figure it out my self (I am not really good with these types of things)

So, I was wondering if one of you here could help me. Here is the code I currently have, also note: this code works, but it only displays one color. And I want it to display red and/or green for non visible players (depending if they are on the same team or not, green is same team and red isnt) and also to not display or alter anything when the player is directly visible.

Code:
local chams_mat = CreateMaterial("deznutz", "VertexLitGeneric", { ["$basetexture"] = "models/debug/debugwhite", ["$model"] = 0, ["$ignorez"] = 0 })

hook.Add("HUDPaintBackground", "LL_HudDrawHook", function()
    local color = Color(0,255,0)
    local color2 = Color(255,0,0)
    local color3 = Color(255,255,255)
    for k,v in pairs(ents.FindByClass("player")) do
        cam.Start3D()
            //Chams code
            v:DrawModel()
            render.SuppressEngineLighting(true)
            render.SetColorModulation((color.r / 255), (color.g / 255), (color.b / 255))
            render.MaterialOverride(chams_mat1)
            v:DrawModel()
            render.SuppressEngineLighting(false)
        cam.End3D()
    end
end
Why are you calling DrawModel twice???

Anyways, the idea behind drawing players different colors through walls (without having to do expensive traces) is to draw 1 model with ignoreZ (the color you want to see through the wall) and one model without ignoreZ after, with a different color.

I could be wrong though, I never did chams but I'm assuming that's how you would do it.
No no man, that makes perfect sense. I will experiment with that. Thanks.

Oh and also I will clean it up a bit (talking about the drawing model thing).

- - - Updated - - -

EDIT (sort of): So I tried that and it didn't work. Here is the new code, any more ideas?:
Code:
local chams_mat = CreateMaterial("ll_cham_texture", "VertexLitGeneric", { ["$basetexture"] = "models/debug/debugwhite", ["$model"] = 0, ["$ignorez"] = 0 })
local chams_mat_noz = CreateMaterial("ll_cham_texture1", "VertexLitGeneric", { ["$basetexture"] = "models/debug/debugwhite", ["$model"] = 1, ["$ignorez"] = 1 })

cam.Start3D()
	v:DrawModel()
	//Chams code
	local color2 = Color(255,0,0)
	render.SuppressEngineLighting(true)
	render.SetColorModulation((color2.r / 255), (color2.g / 255), (color2.b / 255))
	render.MaterialOverride(chams_mat_noz)
	
	render.SetColorModulation((color.r / 255), (color.g / 255), (color.b / 255))
	render.MaterialOverride(chams_mat)
	render.SuppressEngineLighting(false)
cam.End3D()
Ill write something quick in a few mins, just got home and tired :S
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us