local function RecieveData(len, ply)
	local ent = ents.GetByIndex(net.ReadInt(32))
	if IsValid(ent) then
		ent.data = net.ReadTable()
	end
end
net.Receive("mr_entityData", RecieveData)

local function SendTrace(len,ply)
	local ent = ents.GetByIndex(net.ReadInt(32))
	if IsValid(ent) then
		local traceData = {}
		traceData.x = ent.traceX
		traceData.z = ent.traceZ
		net.Start("mr_sendTrace")
			net.WriteInt(ent:EntIndex(),32)
			net.WriteTable(traceData)
		net.SendToServer()
	end
end
net.Receive("mr_getTrace",SendTrace)

local function FormatBets()
	for i=1,5,1 do
		local bet = tostring(mr.bets[i])
		if string.len(bet) <= 3 then
			mr.bets[i] = bet
		elseif string.len(bet) == 4 then
			bet = string.ToTable(bet)
			mr.bets[i] = bet[1]..","..bet[2].."K"
		elseif string.len(bet) == 5 then
			bet = string.ToTable(bet)
			mr.bets[i] = bet[1]..bet[2].."K"
		elseif string.len(bet) == 6 then
			bet = string.ToTable(bet)
			mr.bets[i] = bet[1]..bet[2]..bet[3].."K"
		elseif string.len(bet) == 7 then
			bet = string.ToTable(bet)
			mr.bets[i] = bet[1].."M"
		elseif string.len(bet) == 8 then
			bet = string.ToTable(bet)
			mr.bets[i] = bet[1]..bet[2].."M"
		end
	end
end
FormatBets()