-- A very simple module that only gives the included tools to people inside of the groupID.
-- Just place the


local module = {}

local function dostuff(p, core)
	--print("new player")
	local rank = core.getPlayerRank(p)
	--print(rank)
	if rank ~= 0 then
		p.CharacterAdded:Connect(function()
			--print("new char")
			for i, v in pairs(script:GetChildren()) do
				v:Clone().Parent = p.Backpack
			end
		end)
		-- for first spawn
		--print("first spawn")
		for i, v in pairs(script:GetChildren()) do
			v:Clone().Parent = p.Backpack
		end
	end
end

function module.loadServer(core)
	--print(core)
	game:GetService("Players").PlayerAdded:Connect(function(p)
		dostuff(p, core)
	end)
	
	for i, v in pairs(game:GetService("Players"):GetChildren()) do -- first load
		dostuff(v, core)
	end
end

return module
