Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make so pepole pepole get 4 random weapons from the catalog everytime they spawns?

How do i make so pepole pepole get 4 random weapons from the catalog everytime they spawns?

1 comment

0

at least 1

1 answer

You will need to make a table of all the IDs of the weapons on the catalog, which might be a hard work. Then just put this inside a global script:

game.Players.PlayerAdded:connect(function(p)
	p.CharacterAdded:connect(function(a)
		local v=p
		for i=1,4 do
			local rnd=math.random(1,#ids) -- ids must be the weapon ID table
			game:service("InsertService"):LoadAsset(ids[rnd]).Parent=v.Backpack
		end
	end)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.