Help with radio

Im making an radio that plays music when you press it but for some reason when you press the icon in the entity menu it wont spawn i think there is something in init.lua thats wrong but can someone that has some experience look trought it plz

THE INIT FILE


AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )
include( ‘shared.lua’ )
–sound/

local path
local s1 = Sound( “music/01.mp3” )
local s2 = Sound( “music/02.mp3” )
local s3 = Sound( “music/03.mp3” )
local s4 = Sound( “music/04.mp3” )
local s5 = Sound( “music/05.mp3” )
local s6 = Sound( “music/06.mp3” )
function ENT:Initialize()
self.Entity:SetModel( “models/props/cs_office/radio.mdl” )
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )
local ent = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()

end
end

function ENT:Use()

         local randomnum = math.random(1, 6)
     
	 if (randomnum == 1) then
	     self.ENT:EmitSound( s1 )
     elseif (randomnum == 2) then
	     self.ENT:EmitSound( s2 )
	 elseif (randomnum == 3) then
	     self.ENT:EmitSound( s3 )
     elseif (randomnum == 4) then
	     self.ENT:EmitSound( s4 )
     elseif (randomnum == 5) then
	     self.ENT:EmitSound( s5 )
     elseif (randomnum == 6) then
	     self.ENT:EmitSound( s6 )
		 
		 
		 
		
		 
		 
		 
		 
		 
		 
		 
 end    

end


The cl_init


ENT.Spawnable = true
ENT.AdminSpawnable = true

include(‘shared.lua’)


The shared


ENT.Type = “anim”
ENT.Base = “base_gmodentity”
ENT.PrintName = “Radio”
ENT.Author = “Christian”
ENT.Category = “RP Stuff”


BTW how do you make a code window in the forum page?

Use lua tags or you won’t get any help

Yea that was what i asked for on the end i dont know how to use them

Code tags are alot better, in my opinion. Don’t break the page margin, users in IE can see the code, etc. The only downside is the lack of syntax highlighting.

It’s


 Code here! [ /code] -- Without the space

Use [lua] Lua code here [ /lua] without the space.

Gah, the lack of tables…

[lua]local sounds = {
Sound( “music/01.mp3” ),
Sound( “music/02.mp3” ),
Sound( “music/03.mp3” ),
Sound( “music/04.mp3” ),
Sound( “music/05.mp3” ),
Sound( “music/06.mp3” ),
}

function ENT:Initialize()
self.Entity:SetModel( “models/props/cs_office/radio.mdl” )
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )
local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then phys:Wake() end
end

function ENT:Use() self.Entity:EmitSound(table.Random(sounds)) end[/lua]

There you go.