Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 8 years ago

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.

0
Are you asking how to give random weapons to random players? MrLonely1221 701 — 8y
0
yes herman402 0 — 8y
0
Sorry I can't see it clearly herman402 0 — 8y
0
You can't see my answer? MrLonely1221 701 — 8y
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. EzraNehemiah_TF2 3552 — 8y

Closed as Not Constructive by EzraNehemiah_TF2 and BlueTaslem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 8 years ago

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.

0
This would work, but "getn" is deprecated. You should use the # operator instead. Vrakos 109 — 8y
Ad