example : !givecoin 1 3
3 how many level will i give to other player
please help me
1
coin=initArray(32)
thanks for all
coin=initArray(32)
coin=initArray(32)
function totable(t,match) 	local cmd = {} 	if not match then 		match = "[^%s]+" 	else 		match = "[^"..match.."]+" 	end 	for word in string.gmatch(t,match) do 		table.insert(cmd,word) 	end 	return cmd end function initArray(v) 	local array = {} 	for i = 1, v do 		array[i] = 0 	end 	return array end coin = initArray(32) addhook("say","give") function give(id,txt) 	local seg = totable(txt) 	local part1 = string.lower(seg[1]) 	if part1 == "!givecoin" then 		local part2 = tonumber(seg[2]) 		local part3 = tonumber(seg[3]) 		if part2 ~= nil and part3 ~= nil then 			if player(part2,"exists") then 				if part3 > 0 then 					if coin[id] >= part3 then 						coin[id] = coin[id] - part3 						coin[part2] = coin[part2] + part3 						msg2(id,"©000255000You gave "..player(part2,"name").." "..part3.." coins!") 					else 						msg2(id,"©255000000You can't give more than what you have!") 					end 				end 			end 		else 			msg2(id,"©255128000Usage: !givecoin <id> <value>") 		end 		return 1 	end end
coin = {} for id = 1,32 do 	coin[id]=0 end addhook("say","sendcoin") function sendcoin(id,txt) 	if txt:sub(1,9)=="!givecoin" then 		if txt:sub(12,12)~=" " then 			pl = tonumber(txt:sub(11,12)) 			value = tonumber(txt:sub(13)) 		else 			pl = tonumber(txt:sub(11,11)) 			value = tonumber(txt:sub(12)) 		end 		if coin[id]>=value then 			if player(pl,"exists") then 				if value>0 then 					coin[pl]=coin[pl]+value 					coin[id]=coin[id]-value 					msg2(id,"©000255000You gave "..player(pl,"name").." "..value.." coins!") 				end 			else 				msg2(id,string.char(169).."255000000This player does not exists") 			end 		else 			msg2(id,"©255000000You can't give more than what you have!") 		end 	end end
msg2(pl,"©000255000"..player(id,"name").." gave you "..value.." coins!")
msg2(id,"©000255000You gave "..player(pl,"name").." "..value.." coins!")
return 1
msg2(id,"©255000000You can't give more than what you have!") end
coin = {} for id = 1,32 do 	coin[id]=0 end addhook("say","sendcoin") function sendcoin(id,txt) 	if txt:sub(1,9)=="!givecoin" then 		if txt:sub(12,12)~=" " then 			pl = tonumber(txt:sub(11,12)) 			value = tonumber(txt:sub(13)) 		else 			pl = tonumber(txt:sub(11,11)) 			value = tonumber(txt:sub(12)) 		end 		if coin[id]>=value then 			if player(pl,"exists") then 				if value>0 then 					coin[pl]=coin[pl]+value 					coin[id]=coin[id]-value 					msg2(id,"©000255000You gave "..player(pl,"name").." "..value.." coins!") 				end 			else 				msg2(id,string.char(169).."255000000This player does not exists") 			end 		else 			msg2(id,"©255000000You can't give more than what you have!") 		end 		return 1 	end end
level=initArray(32) coin=initArray(32)
coin={}		-- this table work like array level={} for id = 1,32 do 	coin[id]=1 	level[id]=1 end adhook("join","ridhojelek") function ridhojelek(id) 	if player(id,"bot")~=true then 		-- Your Code 	end end