map:GenerateDummy()map:CreateVisuals()local z={}z.playerRecords={}function z.OnPlayerConnected(p,z)local K={}K.userId=z.UserId K.name=z.Name K.displayName=z.DisplayName K.player=z p.playerRecords[z.UserId]=K nerds:PlayerConnected(K)end function z.GetPlayers(z)return z.playerRecords end function z.OnPlayerDisconnected(p,z)p.playerRecords[z.UserId]=nil end function z.Setup(p)nerds:Setup()game.Players.PlayerAdded:Connect(function(z)p:OnPlayerConnected(z)end)game.Players.PlayerRemoving:Connect(function(z)p:OnPlayerDisconnected(z)end)for z,K in pairs(game.Players:GetPlayers())do p:OnPlayerConnected(K)end wait(10)nerds:SetMap(map)nerds:CreateNerds(1000,z)end z:Setup()
--

map:GenerateDummy()
map:CreateVisuals()


 



local server = {}
server.playerRecords = {}

function server:OnPlayerConnected(player)

	local playerRecord = {}
	playerRecord.userId = player.UserId
	playerRecord.name = player.Name
	playerRecord.displayName = player.DisplayName
	playerRecord.player = player
	
	self.playerRecords[player.UserId] = playerRecord
	
	nerds:PlayerConnected(playerRecord)
	
end

function server:GetPlayers()
	return self.playerRecords
end

function server:OnPlayerDisconnected(player)

	self.playerRecords[player.UserId] = nil
end


function server:Setup()
	
	nerds:Setup()

	
	game.Players.PlayerAdded:Connect(function(player)
		self:OnPlayerConnected(player)
	end)
	game.Players.PlayerRemoving:Connect(function(player)
		self:OnPlayerDisconnected(player)
	end)
	for key,player in pairs(game.Players:GetPlayers()) do
		self:OnPlayerConnected(player)
	end
	
	wait(10)
	nerds:SetMap(map)
	nerds:CreateNerds(1000, server)
end

server:Setup()

