generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Roxer9000 is not online. 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 is not online. 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 is not online. 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 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
15 Sep 2014 07:28 PM
[ Content Deleted ]
Report Abuse
Roxer9000 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image