miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 03:54 PM |
What does this do!?! I get confused :P
number = math.random(1,#_G.myTable) game.Players[_G.myTable[number]].Character.Torso.CFrame = CFrame.new(-81.5, 1, 92) table.insert(_G.myTable2,_G.myTable[number]) table.remove(_G.myTable,number) wait() game.Players[_G.myTable[number]].Character.Torso.CFrame = CFrame.new(-32.5, 1, 92) table.insert(_G.myTable2,_G.myTable[number]) table.remove(_G.myTable,number)
What I want it to do is gets random person from table, teleports them, same person gets inserted and removed from another table. Then it happens again. Now, does this do what I want or does it Do CFrame, different person inserted, different person removed? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 10 Jan 2012 03:59 PM |
Alright, I'll do this for you because you've been trying to do this for something like 3 days and I'm getting annoyed seeing the same thread constantly
local t1={"nate890","miz656"} local t2={} local pos={ CFrame.new(-81.5, 1, 92); CFrame.new(-32.5, 1, 92) }
for i=1,2 do local num=math.random(1,#t1) game.Players[t1[num]].Character.Torso.CFrame=pos[i] table.insert(t2,t1[num]) table.remove(t1,num) end
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 04:00 PM |
@nate
I don't want that because it would only work for us two!
And how did this thread get so popular :P |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 10 Jan 2012 04:02 PM |
local t1={} for i,p in pairs(game.Players:GetPlayers()) do table.insert(t1,p.Name) end local t2=t1
local pos={ CFrame.new(-81.5, 1, 92); CFrame.new(-32.5, 1, 92) }
for i=1,2 do local num=math.random(1,#t1) game.Players[t1[num]].Character.Torso.CFrame=pos[i] table.insert(t2,t1[num]) table.remove(t1,num) end
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 04:03 PM |
| Have you ever thought you're not getting answers because nobody knows what you're trying to do, or that your script is unclear (i.e. variables could possibly be too vague names so we have no clue what they're supposed to represent?) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 10 Jan 2012 04:04 PM |
King, first time I saw this post by miz, I had no idea what it was supposed to do, so I didn't bother posting.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 04:04 PM |
| Should I show you the WHOLE script? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 04:06 PM |
_G.eliminated = {} _G.myTable2 = {} while wait() do if game.Players.NumPlayers >=2 then local h = Instance.new("Hint",Workspace) h.Name = "Round" for i = 20,0,-1 do wait(1) h.Text = "You have "..i.." seconds until the match." if h.Text == "You have 0 seconds until the match." then number = math.random(1,#_G.myTable) game.Players[_G.myTable[number]].Character.Torso.CFrame = CFrame.new(-81.5, 1, 92) table.insert(_G.myTable2,_G.myTable[number]) table.remove(_G.myTable,number) wait() game.Players[_G.myTable[number]].Character.Torso.CFrame = CFrame.new(-32.5, 1, 92) table.insert(_G.myTable2,_G.myTable[number]) table.remove(_G.myTable,number) wait(1) for j = 60,0,-1 do wait(1) h.Text = "You have "..j.." seconds until round is over." end wait(10) if game.Players.NumPlayers >=2 then h:Destroy() else end end end end end
|
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Jan 2012 04:11 PM |
"if game.Players.NumPlayers >=2 then h:Destroy() else end" |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 04:12 PM |
Name your variables something we can understand. Naming them MyTable and MyTable2 do nothing to tell us what's being stored in them or why they're important.
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 10 Jan 2012 04:13 PM |
Lawl, "Name your variables something we can understand. Naming them MyTable and MyTable2 do nothing to tell us what's being stored in them or why they're important." Exactly why I don't want to see this post again. _G.MyTable, _G.MyTable2, just annoys me whenever seeing that.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 10 Jan 2012 04:14 PM |
| _G.myTable{} is all the players in that table. |
|
|
| Report Abuse |
|
|