Proxy
|
  |
| Joined: 24 Apr 2008 |
| Total Posts: 42 |
|
|
| 08 Feb 2016 11:15 PM |
for i,v in pairs (game.Players:GetChildren()) do if v.Name ~= "Proxy" then end print(v.Name) end
it still just prints my name and everyone elses. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 11:19 PM |
The reason why you are receiving that result is simply because your "print(v.Name)" function signal outside of the range of your conditional statement.
Consider this:
if(1 + 1 == 2)then
print("Simple sum");
end
Versus this:
if(1 + 1 == 2)then
end
print("Simple sum");
The first example will print only if "1 + 1 == true" evaluates to true. The second function signal will execute regardless of the conditional statement, because it is not enclosed within the scope/range of said conditional statement. |
|
|
| Report Abuse |
|
|
Proxy
|
  |
| Joined: 24 Apr 2008 |
| Total Posts: 42 |
|
| |
|
|
| 08 Feb 2016 11:32 PM |
Substitute your original Lua expression for this:
"if v.Name ~= "Proxy" then
print(v.Name)
end
end"
The first "end" keyword merely defines the cessation of the conditional statement's range. As a result, if you add the "print(v.Name)" prior to adding the "end", it will be within the range of the statement. |
|
|
| Report Abuse |
|
|
T00NAMI
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 211 |
|
|
| 08 Feb 2016 11:37 PM |
for i,p in pairs game.Players:GetPlayers() do if p.Name == "Proxy" then print(p.Name) end end
but since players can change usernames, I recommend using userId instead.
Your userId is 333990 so this is what you would do:
for i,p in pairs game.Players:GetPlayers() do if p.userId == 333990 then print("Found: "..p.Name) end end |
|
|
| Report Abuse |
|
|
Proxy
|
  |
| Joined: 24 Apr 2008 |
| Total Posts: 42 |
|
|
| 08 Feb 2016 11:45 PM |
| No I'm trying to make it happen to everyone but me, that's why i ended it when if v.Name == "Proxy" then end |
|
|
| Report Abuse |
|
|
dnd256
|
  |
| Joined: 24 Mar 2009 |
| Total Posts: 1373 |
|
|
| 08 Feb 2016 11:49 PM |
for i,v in pairs (game.Players:GetChildren()) do if v.Name == "Proxy" then else print(v.Name) end end |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 08 Feb 2016 11:50 PM |
This PG really gotta know where to put his eofs XdxDXdxDXDxXDXDxdXD
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
|
| Report Abuse |
|
|
Proxy
|
  |
| Joined: 24 Apr 2008 |
| Total Posts: 42 |
|
|
| 08 Feb 2016 11:52 PM |
read the replies rather then read the post and then respond. i meant to have it happen to others then me.
also ur a skrub with your 2002 alienware laptop |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2016 11:55 PM |
"No I'm trying to make it happen to everyone but me, that's why i ended it when if v.Name == "Proxy" then end"
The "~=" operator will account for this accordingly. Every user with a name that does not match your username will have their username printed to the console. |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 08 Feb 2016 11:59 PM |
for i,v in pairs (game.Players:GetChildren()) do if v.Name ~= "Proxy" then end print(v.Name) end
this is all wong wong wong wong wong below is wite wite wite wite
for _,v in pairs(game:GetService'Players':children()) do; if v.Name~='Proxy' then; print(v.Name); end; end
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 09 Feb 2016 01:49 AM |
'eofs' do you even know what an eof is? It's not an "end", it signifies an *E*nd *O*f *F*ile.
Unsourced whatever already gave you a solution anyways OP. |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 09 Feb 2016 01:51 AM |
*E*nd *O*f *F*unction
pls
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 09 Feb 2016 01:52 AM |
Nope. And even if it did (which it doesn't), you're still wrong considering it's the end to a conditional statement.
ugly. |
|
|
| Report Abuse |
|
|
oni0n
|
  |
| Joined: 04 Nov 2012 |
| Total Posts: 2975 |
|
|
| 09 Feb 2016 01:54 AM |
why don't you prove your intelligence by sitting & sobbing in that little cardboard box in the corner of your room?
you would be doing all of us [mostly me] a favor by not being here
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
AkaLua
|
  |
| Joined: 27 Jul 2012 |
| Total Posts: 526 |
|
|
| 09 Feb 2016 02:04 AM |
I think he's doing very well if he's living in a cardboard box. Its quite hard to fit in them depending on how small they are, and also getting a computer in there! That must be such a squeeze!
-____________________________- |
|
|
| Report Abuse |
|
|
dnd256
|
  |
| Joined: 24 Mar 2009 |
| Total Posts: 1373 |
|
|
| 09 Feb 2016 07:39 AM |
| I think I remember why I left 3 years ago now :~) |
|
|
| Report Abuse |
|
|