Looping custom sounds

I’m making Uber Kleiner (from Dasboschitt’s Gmod idiot box) into a gun.

I need to make “The most annoying sound in the world” loop. Im using the CreateSound function which can loop but the weapon’s sound doesn’t repeat. here’s the code of importance:

[lua]resource.AddFile( “sound/weapons/kleinergun/annoyHEY.wav” )
resource.AddFile( “sound/weapons/kleinergun/annoyloop.wav” )

Start = 0
//AnnoySound = CreateSound( self.Owner, Sound(“weapons/kleinergun/annoyloop.wav”) )
AnnoySound = 0

/---------------------------------------------------------
Think
---------------------------------------------------------
/
function SWEP:Think()
if ( Start == 0 ) then
AnnoySound = CreateSound( self.Owner, Sound(“weapons/kleinergun/annoyloop.wav”) )
Start = 1
end
end

/---------------------------------------------------------
PrimaryAttack
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

if ( Start == 1 ) then

	AnnoySound:Play()
	Start = 2
end

timer.Create("uber_tmr",0.5,1,function()

	AnnoySound:Stop()
	Start = 1
end )

self:ShootBullet( 50, 3, 0.42 )
// Delay Attack
self.Weapon:SetNextPrimaryFire( CurTime() + 0.02 )	

end

function SWEP:ShootBullet( damage, num_bullets, aimcone )

local bullet = {}
bullet.Num 		= num_bullets
bullet.Src 		= self.Owner:GetShootPos()	// Source
bullet.Dir 		= self.Owner:GetAimVector()	// Dir of bullet
bullet.Spread 	= Vector( aimcone, aimcone, 0 )		// Aim Cone
bullet.Tracer	= 4	// Show a tracer on every x bullets 
    bullet.TracerName = "AirboatGunHeavyTracer" // what Tracer Effect should be used
bullet.Force	= 300	// Amount of force to give to phys objects
bullet.Damage	= damage
bullet.AmmoType = "Pistol"

self.Owner:FireBullets( bullet )

self:ShootEffects()

end[/lua]

[lua]resource.AddFile( “sound/weapons/kleinergun/annoyHEY.wav” )
resource.AddFile( “sound/weapons/kleinergun/annoyloop.wav” )

Start = 0
//AnnoySound = CreateSound( self.Owner, Sound(“weapons/kleinergun/annoyloop.wav”) )
AnnoySound = 0

/---------------------------------------------------------
Initialize
---------------------------------------------------------
/
function SWEP:Initialize()

AnnoySound = CreateSound( self.Owner, Sound(“weapons/kleinergun/annoyloop.wav”) )
end

/---------------------------------------------------------
PrimaryAttack
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

if ( Start == 0 ) then

AnnoySound:Play()
Start = 1
end

timer.Create(“uber_tmr”,0.5,1,function()

AnnoySound:Stop()
Start = 0
end )

self:ShootBullet( 50, 3, 0.42 )
// Delay Attack
self.Weapon:SetNextPrimaryFire( CurTime() + 0.02 )
end

function SWEP:ShootBullet( damage, num_bullets, aimcone )

local bullet = {}
bullet.Num = num_bullets
bullet.Src = self.Owner:GetShootPos() // Source
bullet.Dir = self.Owner:GetAimVector() // Dir of bullet
bullet.Spread = Vector( aimcone, aimcone, 0 ) // Aim Cone
bullet.Tracer = 4 // Show a tracer on every x bullets
bullet.TracerName = “AirboatGunHeavyTracer” // what Tracer Effect should be used
bullet.Force = 300 // Amount of force to give to phys objects
bullet.Damage = damage
bullet.AmmoType = “Pistol”

self.Owner:FireBullets( bullet )

self:ShootEffects()

end
[/lua]

please paste code like this, makes it alot easier to debug/read, since there is syntax highlighting

argh i just changed the code after you posted that, how do i post in that format or could you update your to the changes i made?

[.lua]code[/lua]
without a period

try this
[LUA]if ( Start == 1 ) then

    AnnoySound:Play()
    Start = 0
end[/LUA]

Thanks it worked =D