Help w/ Entitie Transparency

Its not throwing any errors and I’ve tried coding this a dozen different ways, its old gmod12 code that used to work fine. For some reason when you touch the entitie, only the shadow turns transparent and not the entitie.

Any takers?

Thanks!!!

[lua]
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(“shared.lua”)

local isTouching = false
local timerCreated = false

function ENT:Initialize()
self.Entity:SetModel(“models/hunter/blocks/cube1x1x025.mdl”)
self.Entity:SetSkin(0)
self.Entity:SetSolid(SOLID_VPHYSICS)
local phys = self.Entity:GetPhysicsObject()
if phys and phys:IsValid() then phys:Wake() end
end

function EnableTransparency( Blox )
Blox:SetNotSolid( true )
Blox:SetRenderMode(RENDERMODE_TRANSALPHA)
Blox:SetColor( Color(173, 255, 47, 100) )
timer.Simple(1, function()
DisableTransparency(Blox)
end)
end

function DisableTransparency( Blox )
Blox:SetNotSolid( false )
Blox:SetRenderMode(RENDERMODE_NORMAL)
Blox:SetColor( Color(173, 255, 47, 255) )
timerCreated = false
end

function ENT:SpawnFunction( ply, tr )
if ( !tr.Hit ) then return end

    local SpawnPos = tr.HitPos + tr.HitNormal * 16
    local ent = ents.Create( self.Classname )

    ent:SetPos( SpawnPos ) 
    ent:Spawn() 
    ent:Activate() 

    return ent 

end

function ENT:StartTouch( ent )
if ( IsValid(ent) and ent:IsPlayer() ) then
isTouching = true
if not timerCreated then
local block = self.Entity

				timer.Simple(.25, function()
					EnableTransparency(block)
					timerCreated = true
				end)
			end
    end

end

function ENT:Touch( ent )
end

function ENT:EndTouch( ent )
end

function ENT:Think()
end

[/lua]

Use Entity:SetRenderMode() in the Initialization of the entity.

I removed all of them then set SetRenderMode( RENDERMODE_TRANSALPHA ) in the initialize and still no luck.

You’ve put it in a wrong place i believe. First of all its client side so use cl_init, and some of the stuff you put goes under a rendering function such as ENT:Draw().

Entitie.
Sorry, I can’t help you with en tities.

Anyways, you gotta change rendermode first, before changing the color.