I was wondering if anyone could give me a script in where it chooses one random player in the game, and then gives them a certain tool/item if they are picked. I am currently making a game and it would really help a bunch!
^u^
I was wondering if anyone could give me a script in where it chooses one random player in the game, and then gives them a certain tool/item if they are picked. I am currently making a game and it would really help a bunch!
^u^
Here you go I guess?
local function giveRandomPlayerTool(tool)
if not game:GetService("Players") or #game.Players:GetChildren() < 1 then return end
local randomPlayer = game.Players[math.random(1,#game.Players:GetChildren())]
local toolClone = tool:Clone()
toolClone.Parent = randomPlayer.Backpack
end
-1 for not giving an explanation at all.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This site isn't a place to ask for free scripts. Make an attempt with your own code for help.