Help with a possibly simple script?

**What I expect to happen: **Well, I want it so when someone is using the voice chat that a little bubble will float above there heads and rotate.
**What actually happens: **It’s just not really working, I don’t get any errors but I don’t see any bubble
**Code: **

init.lua
[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

Include(‘shared.lua’)

function ENT:SpawnFuntion()
if (Player.IsSpeaking) then
local ent = ents.Create(“bubble”)
ent:SetPos(Player.Pos + Vector(0, 0, 50))
ent:Spawn()

		return ent

end

function ENT:Initialize()

	self.Entity:SetModel( "models/extras/info_speak.mdl" )
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( NONE_BPHYSICS )

self.Entity:SetNetworkedBool("speaking", true, true)

local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
	phys:Wake()
end

end

function ENT:Think()
if (self.Entity:GetNetworked(“speaking”)) then return end
else return false
end
end
[/lua]

cl_init.lua
[lua]include('share.lua")

function ENT:Draw()

self:DrawEntityOutline( 1.0 )
self.Entity:DrawModel()

end
[/lua]

**Notes: **I am probobly going around this whole thing the complete wrong way, I only recently started Lua coding and i’m still trying to get the hang of it, any help would be greatful ^^

You are getting it a bit wrong, I’m afraid. ENT:SpawnFunction has 2 arguments, ply and tr. In your SpawnFunction you seem to have a variable called Player out of nowhere. That won’t work.

Also ENT:SpawnFunction(ply,tr) doesn’t control when an entity should spawn, it just controls what exactly happens when you spawn it using the Entities tab in the spawn menu. Like putting it in front of where the player’s looking.

Also it’s player:IsSpeaking() rather than player.IsSpeaking, and player:GetPos() rather than player.Pos.

If you want to make it show an icon when the player’s got his mic key held down, you’d need some script on the client in autorun/client (since player:IsSpeaking() seems to be client only according to the wiki) that draws the icon above a player’s head when he’s voice chatting.

He’s also missing an “end” in the spawn function. And he misspelled “function”

Hmm… Okey, mebbe I need to review the basics a little more, sorry for the wasted time =P

SOLID_VPHYSICS vs SOLID_BPHYSICS