Active camo whilst standing still.

Hey I want to make it so that when someone is using a swep (in this case it’s a knife) and are standing still their character will turn transparent and play a sound! Creds will be given!

Here’s the main jizz of the idea

[lua]
if OwnerObjectHere:IsValid() then

if OwnerObjectHere:GetVelocity() > 0 then

	OwnerObjectHere:SetColor( 255, 255, 255, 255 )
else

	surface.PlaySound( "/music/hl2_song20_submix0.mp3" ) --which ever
	OwnerObjectHere:EmitSound( "Path/To/Sound.wav", 500, 200 ) --you wanted
	OwnerObjectHere:SetColor( 255, 255, 255, 0 )
end

end
[/lua]

Okay so what are theese, “surface.PlaySound” and “OwnerObjectHere:EmitSound” is surface like what you hear and emit is what someone who is near you hears?

The wiki is so advanced in this future age that it even has a bar on the left to search things.

Thanks, no need to be a little arse though. :slight_smile:

No need to not look yourself though before posting :slight_smile:

Okay, so this would be the final script?
function SWEP:Initialize()
if OwnerObjectHere:IsValid() then

if OwnerObjectHere:GetVelocity() > 0 then

	OwnerObjectHere:SetColor( 255, 255, 255, 255 )
else

	OwnerObjectHere:EmitSound( "sound/OctoCamo.wav", 300, 100 ) 
	OwnerObjectHere:SetColor( 255, 255, 255, 0 )
end

end

No, this would: [lua]function SWEP:Think()
local owner = self.Owner
if owner:GetVelocity():Length() > 0 then
owner:SetColor(255, 255, 255, 255)
else
owner:SetColor(255, 255, 255, 0)
owner:EmitSound(“sound/OctoCamo.wav”, 300, 100)
end
end[/lua]

Awesome, Thanks alot you two!