help makeing server side function

hi i am trying to make a function to be called by a entity to get a specific number and the entity gives me this error:


 
...dons\ice mining addon\lua\entities\blue_ice\init.lua:28: attempt to call global 'AddIceRoid' (a nil value)

and the server side code for the function is



local iceroids = {}

function AddIceRoid(ent, res, ammount)
	local AddRoid
	AddRoid.ent = ent
	AddRoid.ent.res = res
	AddRoid.ent.ammount = ammount
	table.insert(iceroids, AddRoid)
	return true
end
hook.Add( "IceMineingAddon", "AddIceRoid", AddIceRoid)


can anyone please tell me why it wont call the function?

Thanks

[lua]
local iceroids = {}

function AddIceRoid(ent, res, amount)
local AddRoid = {}
AddRoid.ent = ent
AddRoid.res = res
AddRoid.amount = amount
table.insert(iceroids, AddRoid)
end
hook.Add( “IceMineingAddon”, “AddIceRoid”, AddIceRoid)
[/lua]

“IceMineingAddon”, is that a valid Hook?

read this http://wiki.garrysmod.com/?title=Concommand
and use this for commands…
http://wiki.garrysmod.com/?title=Concommand.Add

local AddRoid = {}

Also, we don’t know why it won’t call the function, you have to give us more code.

nevermind i fixed it thx for the help