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: Java--- Please tell me what im doing wrong

Previous Thread :: Next Thread 
davchi1 is not online. davchi1
Joined: 12 Sep 2008
Total Posts: 753
18 Jul 2014 11:26 AM
confirm ("Are you ready to get started!")

var age = prompt("What's your age")

if (age < 13)

{
console.log ("You can play but I take no responsibility")
}

}
else

{
console.log ("seems like your old enough to play")
}
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
18 Jul 2014 11:28 AM
Java != JavaScript.

But JavaScript probably needs semicolons.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
18 Jul 2014 11:35 AM
Last time I checked roblox ran on Lua not Java...
Report Abuse
Falq is not online. Falq
Joined: 31 Dec 2007
Total Posts: 2521
18 Jul 2014 11:40 AM
1.

JAVA != JAVASCRIPTTTTTTT

2. SEMICOLONS AT LE END OF STATEMENTS
Report Abuse
TaaRt is not online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
18 Jul 2014 11:40 AM
Again, it's not Java
Also ROBLOX itself doesn't run on Lua
JavaScript does need ; after each statement
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
18 Jul 2014 11:41 AM
Eh, that's a minor detail. He is probably better off on Stack Exchange, where people who know these things are, but he can post it, although it might remain unanswered.
Report Abuse
davchi1 is not online. davchi1
Joined: 12 Sep 2008
Total Posts: 753
18 Jul 2014 11:45 AM
I figured out I put an extra bracket above else
Report Abuse
Rindyr is not online. Rindyr
Joined: 30 Apr 2013
Total Posts: 75
18 Jul 2014 08:35 PM
@Taa Your half right, Roblox doesn't run completely on Lua, But it does at the same time. A better way to put it is that Roblox is half lua, and half of a nother language, which with Lua and RBX is C as Lua integrates seamlessly into C and C++ code.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jul 2014 02:59 AM
Lua requires C to run, but as we cannot use the underlying C++ directly, you could say that ROBLOX only uses Lua (as it is all we can use)
Report Abuse
Excession is not online. Excession
Joined: 09 Sep 2011
Total Posts: 2674
19 Jul 2014 03:02 AM

confirm ("Are you ready to get started!")

var age = prompt("What's your age")

if (age < 13) {
console.log ("You can play but I take no responsibility")
} else {
console.log ("seems like your old enough to play")
}

JavaScript does something called "semicolon insertion" which means you can actually write code that omits the semicolon in certain places, and they'll basically be added for you when the code is parsed.
Report Abuse
BobertKalinak is not online. BobertKalinak
Joined: 08 Jul 2014
Total Posts: 47
19 Jul 2014 03:04 AM
For future non-Lua questions, you may want to try Stack Overflow.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
19 Jul 2014 03:05 AM
confirm ("Are you ready to get started!")

var age = parseInt(prompt("What's your age"))

if (age) < 13) {
console.log ("You can play but I take no responsibility")
} else {
console.log ("seems like your old enough to play")
}

I removed an extra bracket that led to nothing.
@Everyone... JavaScript doesn't require ; but it can error if used without.
I added parseInt() method in order to keep variable type check on if it is a number.
Report Abuse
Excession is not online. Excession
Joined: 09 Sep 2011
Total Posts: 2674
19 Jul 2014 03:08 AM
@cody

I already gave him a working example.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
19 Jul 2014 06:49 AM
roblox runs on multiple languages. The website uses java (I know this for a fact) roblox uses a type of C (C++ I think) for things like games, and uses it's own version of Lua (Rblx.Lua) to allow is to script, which is also written in a type of C (Not sure which this one is, C, C# or C++) If your one of those that counts HTML a programming language, it also uses that, and then it uses a type of programming to secure login info, I have no idea what it uses for this. If I'm missing any please enlighten me.


In a nutshell, because it's the only one we can use, I just say it runs on Rblx.Lua.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
19 Jul 2014 06:51 AM
It also uses a wiki writing language, I forget the technical term, which some people might count.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
19 Jul 2014 06:53 AM
war, what website uses java?
because roblox does not.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jul 2014 06:56 AM
"roblox runs on multiple languages. The website uses java (I know this for a fact) roblox uses a type of C (C++ I think) for things like games, and uses it's own version of Lua (Rblx.Lua) to allow is to script, which is also written in a type of C (Not sure which this one is, C, C# or C++) If your one of those that counts HTML a programming language, it also uses that, and then it uses a type of programming to secure login info, I have no idea what it uses for this. If I'm missing any please enlighten me."

The website does not run Java. It uses HTML (Obviously), JavaScript, ASP, OpenGL (The website variant), the wiki uses PHP, the game and Studios run C++ (with Lua integrated).

HTML is NOT a programming language! It is a MARKUP language (HyperText Markup Language)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
19 Jul 2014 07:01 AM
Oops I said Java XD

I meant JavaScript, I really shouldn't be typing fast.

As for HTML I know that, but some people do count it as a type of programming language (Don't ask why)

As for php and others, thank you for extending my list ;D
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jul 2014 07:02 AM
Because it isn't a programming language. It just tells a program what a website looks like.
Report Abuse
TaaRt is not online. TaaRt
Joined: 26 Apr 2009
Total Posts: 5039
19 Jul 2014 09:06 AM
It's basically a discussion of what you define to be "run on". My initial thought would be the very core of something, and since Lua needs another language to run at all I don't consider it to be "running on" Lua, yet most objects (be it they're xml objects) are scripted with Lua
Report Abuse
Excession is not online. Excession
Joined: 09 Sep 2011
Total Posts: 2674
19 Jul 2014 11:27 AM
HTML is a markup language, not a programming one. The ROBLOX website uses AJAX (JavaScript) and ASAP.NET for everything dynamic such as Sending/Receiving Messages, Customizing you character, Changing account settings, Trading.. etc (nearly all of the website features rely on ASP.NET) AJAX is implemented in the Character Customizer so you can instantly see the change on your character (only the character part of the page refreshes, and not the whole page) and in other parts of the website such as browsing group members by rank etc
Report Abuse
Excession is not online. Excession
Joined: 09 Sep 2011
Total Posts: 2674
19 Jul 2014 11:29 AM
HTML should not be categorized as an programming language because you can not really do anything you can do with a programming / scripting language such as creating if statements, loops, variables etc.

Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
19 Jul 2014 12:00 PM
Not sure if anyone mentioned since I hadn't read all the replies but your confirm is useless, and console.log writes to the console so make sure that is opened.

var conf = confirm("Are you ready to get started!");
if(conf)
console.log(prompt("What's your age") < 13 ? "You can play but I take no responsibility" : "seems like your old enough to play");
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