|
| 01 Feb 2015 05:14 AM |
i keep forgetting how to address players
may someone tell me?
i'm trying to use math.random |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 01 Feb 2015 08:37 AM |
for a single player: game.Players.Maxomega3 for all players in a game: game.Players:GetPlayers () |
|
|
| Report Abuse |
|
|
Haxisy
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 160 |
|
| |
|
| |
|
|
| 01 Feb 2015 09:55 AM |
may i ask, how would i use
game.Players:GetPlayers () and math.random to select a player and give him a tool depending on the class?
my script so far is this
local classes = { "Executioner"; "Civilian" }
r = math.random(1,2) m = Instance.new("Message")
while true do if r == 1 then wait(10) m.Parent = workspace m.Text = "A New Round Is Starting" wait(3) m.Text = "The new nap is (map name)" wait(2) m.Parent = nil game.Lighting.(map name):Clone.Parent = Game.Workspace end end |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Feb 2015 10:05 AM |
Lighting isn't as reliable as serverstorage.
also, use
plrs = game.Players:GetChildren()
randomplayer = plrs[math.random(1,#plrs)] |
|
|
| Report Abuse |
|
|
| |
|