Roxer9000
|
  |
| Joined: 09 Sep 2010 |
| Total Posts: 5254 |
|
|
| 15 Sep 2014 07:24 PM |
lets say they're only 5 values in this model called metime, and we do: for i,v in pairs(workspace.metime:children()) do
end how would we make it find the highest number value
bitte ein bier |
|
|
| Report Abuse |
|
|
Rapster2
|
  |
| Joined: 16 Oct 2009 |
| Total Posts: 1865 |
|
|
| 15 Sep 2014 07:26 PM |
local largestValue = 0;
for _,v in pairs(game.Workspace:GetChildren()) do if v.Value > largestValue then largestValue = v.Value end end
If it weren't for attorneys, we wouldn't need attorneys. |
|
|
| Report Abuse |
|
|
Rapster2
|
  |
| Joined: 16 Oct 2009 |
| Total Posts: 1865 |
|
|
| 15 Sep 2014 07:27 PM |
EDIT:
local largestValue = 0;
for _,v in pairs(game.Workspace.metime:GetChildren()) do if v.Value > largestValue then largestValue = v.Value end end
If it weren't for attorneys, we wouldn't need attorneys. |
|
|
| Report Abuse |
|
|
murcury57
|
  |
| Joined: 30 Jun 2010 |
| Total Posts: 90299 |
|
| |
|
Roxer9000
|
  |
| Joined: 09 Sep 2010 |
| Total Posts: 5254 |
|
|
| 16 Sep 2014 03:25 PM |
how does it determine it like that? sorry I'm a bit confused
bitte ein bier |
|
|
| Report Abuse |
|
|
Rapster2
|
  |
| Joined: 16 Oct 2009 |
| Total Posts: 1865 |
|
|
| 16 Sep 2014 04:36 PM |
I'm going to go with the other guy's solution to explain.
Basically, it sets a variable to the lowest possible number.
Then, it takes every one of the children of metime, and checks if the value of it is larger then the variable. If it is, then it sets the variable to that value. Once it has looped through all the children, the value left is the largest value.
If it weren't for attorneys, we wouldn't need attorneys. |
|
|
| Report Abuse |
|
|