function module.InsertStat(w,l,d,Z,z)if updating and not z then repeat wait(.1)until not updating end l=tostring(l)if z then table.insert(z[d],Z)z.DataToUpdate=true else table.insert(main.sd[l][d],Z)main.sd[l].DataToUpdate=true end end function module.ChangeStat(z,l,d,Z)if updating then repeat wait(.1)until not updating end main.sd[l][d]=Z main.sd[l].DataToUpdate=true end

function module:InsertStat(key, statName, value, specificData)
	if updating and not specificData then repeat wait(0.1) until not updating end
	key = tostring(key)
	if specificData then
		table.insert(specificData[statName], value)
		specificData.DataToUpdate = true
	else
		table.insert(main.sd[key][statName], value)
		main.sd[key].DataToUpdate = true
	end
end

function module:ChangeStat(key, statName, newValue)
	if updating then repeat wait(0.1) until not updating end
	main.sd[key][statName] = newValue
	main.sd[key].DataToUpdate = true
end


