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
 

Re: ?????????

Previous Thread :: Next Thread 
greatgavin is not online. greatgavin
Joined: 20 Jul 2009
Total Posts: 389
12 Oct 2013 09:19 PM
OK, complete simple I thinks. Theres a 4 number values in workspace, theres an intvalue in workspace. Number values called number1, number2, number3, and number4 , intvalue called int. SIMMPLE!

Heres the hard or simple part, whatever the part I cant do or understand. How to split the intvalue into the four number values. So basically the int value is 1337, when the script is activated the number values will become the digits like 1 for number1, 3 for number2, 3 for number3, and 7 for number7. Please help me figure out how to make this possible, I think it involves strings but I don't get that part either. This is only part of a big project and I would hate for it to stop here.
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
12 Oct 2013 09:38 PM
double post

each_num = {}
str = tostring(1248731598612340987132486145987625)--random numbers
for i = 1,#str do
each_num[i] = tonumber(string.sub(str,i,i))
end

game.Workspace.Number1.Value = each_num[1]
game.Workspace.Number2.Value = each_num[2]
game.Workspace.Number3.Value = each_num[3]
game.Workspace.Number4.Value = each_num[4]
Report Abuse
greatgavin is not online. greatgavin
Joined: 20 Jul 2009
Total Posts: 389
12 Oct 2013 11:24 PM
ya that's good but how does it connect with the intvalue?
Report Abuse
greatgavin is not online. greatgavin
Joined: 20 Jul 2009
Total Posts: 389
13 Oct 2013 02:24 PM
bump and seriously hows that connect with the intvalue
Report Abuse
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
13 Oct 2013 02:46 PM
Intvalue is a number, and I don't think you can split numbers up.

If you'd use a string instead, you could use this:

string.sub(intvalue, 1, 1)
string.sub(intvalue, 2,2)
etc.

Although in that case, I am not sure if you'd be able to convert it back into numbers.

-Believe and you will achieve-
Report Abuse
08C is not online. 08C
Joined: 26 Jan 2013
Total Posts: 847
13 Oct 2013 03:13 PM
[ Content Deleted ]
Report Abuse
greatgavin is not online. greatgavin
Joined: 20 Jul 2009
Total Posts: 389
13 Oct 2013 05:11 PM
well im trying to make an arcade game and every player has a score leaderboard. I have made it that the person with the highest score, their score goes to a number value in workspace. From their that number value(called ServerHighScore) is split into different digits to make a sign. There are four bricks with a number value in them, and they also have a script and a decal. The script decides the decal based on the value. They are placed near each other so it looks like the score is on there. This is why I need the script.
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