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: I dont know how thats possible?

Previous Thread :: Next Thread 
willieanialater is not online. willieanialater
Joined: 27 Feb 2010
Total Posts: 289
08 Jan 2012 01:59 PM
I was looking at roblox wiki for scripting part and it showed bunch of math stuff an I was like. ... how does this stuff do anything?
i mean like 2(3*3)-(3*3) what can those numbers do?
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
08 Jan 2012 02:02 PM
It means (2*3)+(2*3)-(3*3)
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:03 PM
"2(3*3)-(3*3)"

That would be the order of operations (PEMDAS - parenthesis, exponents, multiplication/division, addition/subtraction).

2(3*3)-(3*3)
2(9) - 9
18 - 9
9

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:05 PM
@dirk

That's the distributive law which I don't think is used in that situation (or at least I'm pretty sure).

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:05 PM
distributive property*

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
willieanialater is not online. willieanialater
Joined: 27 Feb 2010
Total Posts: 289
08 Jan 2012 02:06 PM
No I mean what can those numbers do?
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:11 PM
What do you mean? They don't really 'do' anything except result in another number. Maybe you could store them in a variable if you wanted, but I don't see why you would want to.

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
willieanialater is not online. willieanialater
Joined: 27 Feb 2010
Total Posts: 289
08 Jan 2012 02:19 PM
But it was in roblox wiki as mathematical what can be done with those numbers?
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:20 PM
@willie

Link please. I'm not getting enough information here, unless it was a page explaining how math works in RBX.Lua.

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
bobosaid is not online. bobosaid
Joined: 26 Feb 2011
Total Posts: 10760
08 Jan 2012 02:21 PM
You can make a calculator.
Report Abuse
willieanialater is not online. willieanialater
Joined: 27 Feb 2010
Total Posts: 289
08 Jan 2012 02:21 PM
http://wiki.roblox.com/index.php/Basic_math
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
08 Jan 2012 02:22 PM
e.e Basic math T.T

ˈ˟ˈ About me? I got Remove()'d but came back for I was not Destroy()'d :3 ˈ˟ˈ
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:23 PM
"Lua follows the same order of operations as defined by the rules of mathematics. The mnemonic PEMDAS (parentheses, exponents, multiplication, division, addition, and subtraction) apply to Lua. That means, in the order below, the operations will execute.

1) Parenthesis () 2) Exponents (^) 3) Multiplication and Division (/ or *) 4) Addition or Subtraction (- or +)
That means:

2(3*3) - (3+3) will result in 12."

That does nothing but result in the number twelve.

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
willieanialater is not online. willieanialater
Joined: 27 Feb 2010
Total Posts: 289
08 Jan 2012 02:23 PM
well yeah i know its math but how can it be used to make anything in roblox
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
08 Jan 2012 02:25 PM
Calculate a position between two parts
Calculate the length of a vector
.
.
.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
08 Jan 2012 02:28 PM
Here, this is how I would use basic math

function add(a, b)
return a + b
print(a + b)
end

function sub(c, d)
return c - d
print(c - d)
end

f = add(1, 2)
l = sub(f, 2)

print(l)

I get:
3
1
1

:P


ˈ˟ˈ About me? I got Remove()'d but came back for I was not Destroy()'d :3 ˈ˟ˈ
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
08 Jan 2012 02:30 PM
@willie

You could make your own calculator, as the other person suggested. You could make a raycasting gun. You could get the magnitude between two parts, as fl0x suggested. The possibilities are endless.

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
bobosaid is not online. bobosaid
Joined: 26 Feb 2011
Total Posts: 10760
08 Jan 2012 02:33 PM
All you have to do is use your imagination and the pissiblilities are endless.
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
08 Jan 2012 02:34 PM
@18cwatford
A function ends after returning something, your prints are ignored.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
08 Jan 2012 02:35 PM
T.T
Fine
I Just Woke Up T.T
My Head Isnt Really Scripting Currently E.E

function add(a, b)
print(a + b)
return a + b
end

-_-

ˈ˟ˈ About me? I got Remove()'d but came back for I was not Destroy()'d :3 ˈ˟ˈ
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
08 Jan 2012 02:39 PM
I help there where it is unwanted, but not where it is wanted.
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
08 Jan 2012 02:40 PM
HELP MEH fl0x D:

ˈ˟ˈ About me? I got Remove()'d but came back for I was not Destroy()'d :3 ˈ˟ˈ
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
08 Jan 2012 02:40 PM
Great, now I have to get my post deleted.
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