Making a player invisible

Is there any way to make a player invisible with lua? I cant find a function for something like that except for changing the player model… Which could take a while. hah.

Entity.SetColor

Can you use that on a player?

If I’m correct, yes. Players are entities, too.

I found a different one, im going to try this. self.Owner:SetColor, then ill try what you suggested.

That’s exactly the same thing.

For E2 its not owner():setColor, its owner():setAlpha(0).
But then again E2 and Lua is similair in some ways.

Or you can use a material code like:
entity():setMaterial(“models/effects/vol_light001”)
owner():setMaterial(“models/effects/vol_light001”)
AGAIN this is for E2

Since when are we talking about E2?

what about if i want to make me AND my friend who isnt allowed e2 9no donator) invisible i got here

Then you go to wiremod forums.

On topic:



player:SetRenderMode(RENDERMODE_TRANSALPHA)
player:SetColor( Color(0, 0, 0, 0 ) )


I am not sure if I correctly typed the rendermode stuff.

Okay, so I have an edited version of prop hunt. The playermodels tend to show up combined with the props (like you see the full playermodel running inside a barrel). If I would put this in the class_prop lua, would it work?


// Called when player spawns with this class
function CLASS:OnSpawn(pl)

    self.ph_prop_angle = Angle(0,0,0)
    self.propangles = Angle(0,0,0)
    self.nextangles = Angle(0,0,0)
    self.Owner:SetColor = Vector(0,0,0)
	pl.ph_prop = ents.Create("ph_prop")
	pl.ph_prop:SetPos(pl:GetPos())
	pl.ph_prop:SetAngles(pl:GetAngles())
	pl.ph_prop:Spawn()
	pl.ph_prop:SetSolid(SOLID_BBOX)
	pl.ph_prop:SetParent(pl)
	pl.ph_prop:SetOwner(pl)
	
	pl.ph_prop.max_health = 100

	net.Start("ph_cl_prop")
		net.WriteEntity(pl)
		net.WriteEntity(pl.ph_prop)
	net.Broadcast()
end

EDIT: I just found this, so im gonna try it out:


// Called when player spawns with this class
function CLASS:OnSpawn(pl)
	pl:SetColor( Color(0, 0, 0, 0))
	
	pl.ph_prop = ents.Create("ph_prop")
	pl.ph_prop:SetPos(pl:GetPos())
	pl.ph_prop:SetAngles(pl:GetAngles())
	pl.ph_prop:Spawn()
	pl.ph_prop:SetSolid(SOLID_BBOX)
	pl.ph_prop:SetParent(pl)
	pl.ph_prop:SetOwner(pl)
	
	pl.ph_prop.max_health = 100
end