attempt to index global 'self' (a nil value)

I’m trying to create sounds like this:


function ENT:Initialize()

CreateSounds()

end  

function CreateSounds()
    Sounds.asd = CreateSound(self.Entity,"asd.wav")
    Sounds.fgh = CreateSound(self.Entity,"fgh.wav")    
end

I’m getting this script error:


attempt to index global 'self' (a nil value)

What am I doing wrong?

EDIT: Status as of now


attempt to index local 'self' (a nil value)


function ENT:Initialize()

self.CreateSounds()

end  

function ENT:CreateSounds()
    Sounds.asd = CreateSound(self.Entity,"asd.wav")
    Sounds.fgh = CreateSound(self.Entity,"fgh.wav")    
end



function ENT:CreateSounds()
    Sounds.asd = CreateSound(self.Entity,"asd.wav")
    Sounds.fgh = CreateSound(self.Entity,"fgh.wav")    
end


Should do the trick.

Still getting the exact same script error

EDIT: Just noticed it’s different:


attempt to index local 'self' (a nil value)

[editline]10th March 2015[/editline]

Solved