|
| 25 Jul 2012 04:33 AM |
while script.Parent.Owner ~= ("Nobody") do wait(10) --need to find owner in Players end |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
| |
|
|
| 25 Jul 2012 04:36 AM |
| I don't know how to find a player if they are not touching a part. The script can find which player they are supposed to find from script.Parent.Owner. |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 25 Jul 2012 04:43 AM |
while script.Parent.Owner ~= ("Nobody") do wait(10) players = game.Players:GetChildren() for i = 1, #players do if player[i].Name == "" then --stuf here end end end
Like this? |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2012 04:49 AM |
while script.Parent.Owner ~= ("Nobody") do wait(10) players = game.Players:GetChildren() for i = 1, #players do if player[i].Name == "" then --stuf here end end end
I am not sure why you have to get all the players. I want to change only ONE of there stats. But according to this I assume the 'if player[i].Name == "" then' is to locate the one player I want.
So this works?
if player[i].Name == script.Parent.Owner.Value then player[i].leaderstats.Munny.Value = player[i].leaderstats.Munny.Value + Script.Parent.Munny.Value
(The munny in player and the munny in script.parent ARE diffrent munnys) |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 25 Jul 2012 04:52 AM |
while script.Parent.Owner ~= ("Nobody") do wait(10) players = game.Players:GetChildren() for i = 1, #players do if player[i].Name == "" then if player[i].Name == script.Parent.Owner.Value then player[i].leaderstats.Munny.Value = player[i].leaderstats.Munny.Value + Script.Parent.Munny.Value end end end
This propably works but maybe you have a faulth in the while loop (top line). You know ~= means (is not equal to). |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2012 05:02 AM |
Here is the one that does what I wanted it to do... I had to make a few adjustments to make it work. while script.Parent.Owner ~= ("Nobody") do wait(10) players = game.Players:GetChildren() for i = 1, #players do if players[i].Name == script.Parent.Owner.Value then players[i].leaderstats.Munny.Value = players[i].leaderstats.Munny.Value + script.Parent.Munny.Value end end end
Thanks for your help again! |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 25 Jul 2012 05:15 AM |
| Ya I forgot to remove a line. |
|
|
| Report Abuse |
|
|