Hide HUD if player is cloacked

Hello;
i own RocketMania HUD and he gave me a code to hide HUD if player is cloacked.
I changed my HUD to TCB Premium HUD and i pasted the code where TCB told me to past, but it’s not working.
Here’s the code

if ply:GetMaterial() == “models/effects/vol_light001” then return end

Is it the good way to do it?

Where are you putting that code?

Before local function HUDPaint()
I also tryed after local function HUDPaint()

Okay so what you want to do is put the code after the validity checks in the HUDPaint function ( if there are any )

What i want to do is hide the HUD when the player is cloacked



local function HUDPaint()
     if ply:GetMaterial() == "models/effects/vol_light001" then return end
     -- Above the rest


Thanks, but already tryed, isn’t working

What’s ply? Are you getting an error in the console saying that ply isn’t defined?

[lua]
local function HUDPaint()
if LocalPlayer():GetMaterial() == “models/effects/vol_light001” then return end
[/lua]

Yes

Then why didnt you say so? Thats infinitely more helpful than “its not working”

And does the code that I provided work? :v:

I’ll try asap :smiley:

There is no error, but the hud is still here

Add prints to make sure the code is being ran