I Have A Weapon I Am Working on, But There Are Some Problems.
1. I Can't Get My Player To Turn invisible When I Right Click.
2. I Need Him Frozen In Place When He Is Visible.
Here Is The Script
[CODE]function SWEP:Initialize()
self.Owner:SetRenderMode( RENDERMODE_TRANSALPHA )
end
function SWEP:PrimaryAttack()
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
end
function SWEP:SecondaryAttack()
if self.Owner.Cloaked then
self.Owner:SetColor(Color(255, 255, 255, 255))
self.Owner.Cloaked = false
self.Owner:PrintMessage( HUD_PRINTCENTER, "Visible." )
self.Owner:SetNWBool("Cloaked", true)
else
self.Owner:SetColor(Color(255, 255, 255, 0))
self.Owner.Cloaked = true
self.Owner:PrintMessage( HUD_PRINTCENTER, "Invisible." )
self.Owner:SetNWBool("Cloaked", false)
end
end[/CODE]
If You Can Help Me With This It Would Be Greatly Appreciated!
Bump, Need Some Help Here!
You Don't Need To Write Like This and you need to set the render mode of the player to the transalpha one to use alpha. To freeze you could set the run and walk speed to 0 and restore it later.
Damnit Chessnut. You made a funny and a valid point. I had difficulty deciding either funny or lua helper...
Sorry, you need to Log In to post a reply to this thread.