|
| 03 Sep 2016 05:34 PM |
Is there anyway I could do something like this: Say I have a number of players in a game (take 24 for an example) I divide this up using code (that I don't know how to do) Then, say on my map I have 4 different 'spawns' (actually teleport locations) I want to teleport 6 of these players onto one 'spawn' and then the other 6 on the next and then the other 6 on the next (you get the point).
Is there any way to do this? Thanks |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 05:39 PM |
if team % 2 then -- Code here else -- Code here end |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 05:41 PM |
Allow me to fix my earlier code
local p = game.Players:GetChildren()
for i, v in pairs(p) do if i % 2 then -- Team 1 code else -- Team 2 code end end |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 06:37 PM |
sorry, i didnt mean it like that the players aren't on teams.. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 06:42 PM |
| Not sure if theres an easy way todo this i started learning lua yesterday so i barely know anything but i guess an good solution would just making it select random people for example you have 10 people on there then it will choose 5 random people for each spawn point and if theres 11 it would still just randomise |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 06:50 PM |
what I was thinking but i dont know how to do it! |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 06:53 PM |
local players = game.Players local halfplayers = #players / 2
local spawns = game.Map.Spawns local spawn = game.Map.Spawns:GetChildren
halfplayers.Position = spawn.Position + Vector3.new(0, 3, 0)
this is hard for me this wouldve taken a long time for me to figure out but try this out |
|
|
| Report Abuse |
|
|