Console command run on hook.add

Hey i trayed to make a script that says when x numbers of players is on a server, it will do a command
So far i made it look like this, but it dosent work

[lua]
function command( a )
game.ConsoleCommand("rp_voiceradius " … tostring(a) … "
")
local hint=“Voice” … tostring(a);
for k,v in pairs(player.GetAll()) do
v:SendHint( hint, 7 )
end
end

function Check()
if #player.GetAll() >= 3 then
command(1)
else
command(0)
end
return
end
hook.Add( “PlayerDisconnect”, “playerdisconnected”, Check )
hook.Add( “PlayerInitialSpawn”, “playerInitialSpawn”, Check )
[/lua]

So far i get this error
Hook ‘playerInitialSpawn’ Failed: autorun/playerconnect.lua:4: attempt to index global ‘Player’ (a function value)

can anyone help me with this or maybe make a script that works, if i dident explain this good enough than tell me

in the command function do

[lua]
for k,v in pairs(player.GetAll()) do
v:SendHint( hint, 7 )
end
[/lua]

instead of Player:SendHint

ok
This may fix the problem with not getting a hint, but it do still not change the console command
anyone who can help wit this

You might want to Send it as GameMode:Hint(“Your hint here”)

Or you will get #Send_Hint1: hint here
Goes in init.lua
[lua]function command( a )
game.ConsoleCommand("rp_voiceradius " … tostring(a) … "
")
local hint=“Voice” … tostring(a);
for k,v in pairs(player.GetAll()) do
v:SendLua[[v:SendHint( hint, 7 )]]
end
end

function Check()
if #player.GetAll() >= 3 then
command(1)
else
command(0)
end
return
end
hook.Add( “PlayerDisconnect”, “playerdisconnected”, Check )
hook.Add( “PlayerInitialSpawn”, “playerInitialSpawn”, Check )
[/lua]