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

I need Help! How do you make a randomizer when it chooses two random people out of the server (1v1)?

How do you make a randomizer when it chooses two random people out of the server to go head to head like a 1v1. . Its for a basketball game like the game called "Drop Offs" Or "Hoopz" Please help me out with this i am struggling like heck. Add my Roblox @BenjiYouse and subscribe to my youtube @BenjiYouse. Add my Discord (BenjiYouse#9251)

local InRound = game.ReplicatedStorage.InRound local Player = game.Player.GetPlayerFromCharacter

if InRound == true then Player.Random.Team = ("Random")

1 comment

0

comon man whoever downvoted this is uncool, give the newbies a break

2 answers

Insert a normal script in server script service and paste the following:

Part1 = ___________ --The part the first random player will be teleported to
Part2 = ___________ --The part the second random player will be teleported to

local Players = game.Players:GetPlayers()
local RandomPlayer1 = Players[math.random, #Players]
local RandomPlayer2 = Players[math.random, #Players]

RandomPlayer1.Character.HumanoidRootPart.Position = Part1.Position
RandomPlayer2.Character.HumanoidRootPart.Position = Part2.Position

think you do somethin like this i dum 0:

--get players
local players = game.Players:GetPlayers

--pick random 2
local picked1 = players[math.random(1, #players)]
local picked2 = players[math.random(1, #players)]

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