|
| 22 Oct 2014 03:36 AM |
| To be more specific, I need a script that selects a random Player to receive a special weapon, and have the ability to kill the other players. A good example would be Darkness, the Mad Murderer, or Insanity. The only way I could think of giving the randomly selected Player the ability to kill the others is if it puts him/her in a separate team. However, if you could find a way to work around that, that would be nice, as I don't want the name of the randomly selected Player to be displayed on the Leaderboard. |
|
|
| Report Abuse |
|
|
Ortron
|
  |
| Joined: 19 Jul 2013 |
| Total Posts: 1297 |
|
|
| 22 Oct 2014 04:24 AM |
Try this, (may be wrong)
players=game.PlayersNumPlayers
ChosenOne=math.random(1,#players)
print(ChosenOne, "has been chosen.") |
|
|
| Report Abuse |
|
|
Ortron
|
  |
| Joined: 19 Jul 2013 |
| Total Posts: 1297 |
|
|
| 22 Oct 2014 04:25 AM |
"players=game.PlayersNumPlayers"
players=game.Players.NumPlayers* |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 04:28 AM |
plrs = game.Players.NumPlayers chosen = math.random(1,#plrs) weapon = game.ServerStorage.LinkedSword -- change this weapon:clone().Parent = chosen.Backpack
|
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 04:46 AM |
| Thank you! Would I put the Script in Workspace or StarterGui? And how would I make it so this randomizer is round-based? So that once the player is selected, there will be a certain interval (in this interval, the game will be in-progress), and once the game ends, it selects a new one? Would I just have to do wait(however long I want each round to be)? |
|
|
| Report Abuse |
|
|
Ortron
|
  |
| Joined: 19 Jul 2013 |
| Total Posts: 1297 |
|
|
| 22 Oct 2014 05:58 AM |
The script can be placed in either and to have an interval try this
while true do h=Instance.new("Hint",game,Workspace) h.Text="Round starting in"
for timer=1,30,-1 do H.Text="Round will begin in ", timer," seconds." wait(1) end
(Randomise script here)
end |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 07:16 AM |
Use math.random, for instance:
local wep = game:GetService("ServerStorage"):WaitForChild("YOURWEPHERE") local playerserv = game:GetService("Players") local playing = playerserv.NumPlayers local chooseplr = math.random(1,#playing) wep:clone().Parent = chooseplr.Backpack |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 04:19 PM |
| Thank you guys! The Randomizer script is one of the only things that has been holding me back from finishing my game. That, and getting the first map done. |
|
|
| Report Abuse |
|
|
|
| 22 Oct 2014 04:20 PM |
| None of them will work, math.random() isn't random, it will give the same results in a other server. |
|
|
| Report Abuse |
|
|