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

Who does know how to make auto tool giver like murder games?

Someone help, IDK how to make auto tool giver and I need help so is there any script that can give diffrent tools like sherrif gun and knife.

5 comments

0

Are you asking how to give random weapons to random players?

0

yes

0

Sorry I can't see it clearly

0

You can't see my answer?

0

This isn't a request site. I advise you look at these wiki pages: http://wiki.roblox.com/index.php?title=API:Class/Instance/Clone and http://wiki.roblox.com/index.php?title=API:Class/Backpack. We can't make code for you. Give it a try! If it doesn't work, ask another question and in and we'll fix it as long as there is a script.

1 answer

The easiest way to do this in my opinion is by going like this

-- This is a regular script

local weapons = game.ServerStorage.Weapons:GetChildren(); -- An array of all the weapons in a model called "Weapons" in ServerStorage;

for _, a in pairs(game.Players:GetPlayers()) do -- Getting all the players, a is the variable used to store the player that is currently being given a weapon. This can be anything i.e., "plr", "player", etc.
	local weapon = math.random(1, table.getn(weapons)); -- Selecting a random weapon for the player
	weapons[weapon]:Clone().Parent = a.BackPack; -- Cloning weapon into players backpack
end;

This script is basic and does not show a gui or anything on screen based on what the player got, I'll leave that up to you. ;) If this helped please don't forget to accept this answer.

1 comment

0

This would work, but "getn" is deprecated. You should use the # operator instead.

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