ProxyJoin Date: 2008-04-24 Post Count: 42 |
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. |
|
|
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. |
|
ProxyJoin Date: 2008-04-24 Post Count: 42 |
how would i fix it then? |
|
|
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. |
|
Dev_RyanJoin Date: 2013-03-10 Post Count: 451 |
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 |
|
ProxyJoin Date: 2008-04-24 Post Count: 42 |
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 |
|
dnd256Join Date: 2009-03-24 Post Count: 1373 |
for i,v in pairs (game.Players:GetChildren()) do
if v.Name == "Proxy" then
else
print(v.Name)
end
end |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
This PG really gotta know where to put his eofs XdxDXdxDXDxXDXDxdXD
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
ProxyJoin Date: 2008-04-24 Post Count: 42 |
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 |
|
|
"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. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
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 |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
'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. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
*E*nd *O*f *F*unction
pls
#code cout << "Proof by analogy is fraud." << endl; //Bjarne Stroustrup |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Nope. And even if it did (which it doesn't), you're still wrong considering it's the end to a conditional statement.
ugly. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
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 |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
topkekedgelordmeme [2] |
|
|
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!
-____________________________- |
|
dnd256Join Date: 2009-03-24 Post Count: 1373 |
I think I remember why I left 3 years ago now :~) |
|