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: Programming Tutorial - JavaScript pt.1

Previous Thread :: Next Thread 
Yamahoshi is not online. Yamahoshi
Joined: 26 May 2012
Total Posts: 215
07 Apr 2014 03:16 AM
Did you ever want to use some JavaScript codes on ROBLOX, or make ROBLOX fansites or any kind of website, and make them do cool stuff and look cool? Or make a browser-based game about ROBLOX? Well, I know a lot of JavaScript codes, and today I will teach you on how to JavaScript.

To know the advance, you need to know the basics. Even though a lot of basic stufff don't seem cool, they actually do. They do a lot of useful stuff which can help you develop a cool website.

- 1 - Names & Stuff -

What if you want a code that tells your name or whatever? Computers can read the length of a word and can know your name by just doing simple codes.

1 : Telling your Name

To tell a computer your name, then do a simple code. You don't really need anything much except for your typing skills and your remembering skills.

"yourName"

Fill inside the quote your name and your computer will right away know your name. Though this is only useful sometimes.

2 : Finding out the length of your name

In JavaScript, you can tell your computer to measure the amount of words form your name. In just a simple code, your computer will find how long your name is.

"yourName".length

Just do the same thing as the 1st code I told you, about the computer knowing your name thing, and add the phrase .length. It should respond back with:

4

Simple, isn't it?

- 2 - Math -

Let's start some math, computing, and other programming skills! In JavaScript, you can force computers to do your math work for you without using a calculator. Try this code:

3 + 4
or
2 / 4

Try it. See if the calculations are correct. If not, your computer must be mental.

Divide: /
Multiply: *
Add: +
Subtract: -

2 : Confusing the computer

There are a lot of ways to confuse a computer. It will often say:

"Error: Does not compute"

This is caused by a command mistakenly written, or a command that is not known in any of the computer languages.

Try writing "eggplant". Without the quotes. See if that works in a JavaScript coder.

3 : Things like //

If there is anything with //, then that is a code that the computer will not read and skip. This is for your eyes to see only, so if I do this:

// Hello, test, the computer will not read this!

The computer will not read it. It will be displayed in another color in your JavaScript code editor so your eyes can be attracted to it. It is just like in studio where you do:

-- Hello, test, the computer will not read this!

Instead of

// Hello, test, the computer will not read this!

Easy, eh?

4 : If you want a dialog or a console talking to your website viewer or something, to inform you about the updates or whatever on your website, then do this:

confirm("ROBLOX is a game for kids. Please do not online date!")

It will have a mini browser pop up somewhere in the middle of your screen and will say:

ROBLOX is a game for kids. Please do not online date!
[OK]

The [OK] is the button which will show up on the bottom of the text so the viewer will acknowledge your info and they can continue.

Try it on Blogger or try it on your JavaScript code editor. It'll be fun to mess around with.

5 : Asking names & questions

To ask someone their name virtually, or even ask another question, this is the code for you. It can show a mini browser pop-up with your question. Do the code like this:

prompt("What is your name"?)

After you finish the code, when they enter the website, a mini-browser will pop-up on their screen and it will have your question. Under the question is your answer bar where they will answer your question. Under the answer bar, there is an OK button, so after they finish answering your question, they will click OK and continue.

[ Ending ]

Hey guys! I'm sorry, but I have to end it here. The tutorial will continue soon on pt.2 where I will discuss on how to create browser-based adventure games and stuff. But first, you still need to know the basics, so the basics will help you create a classic broswer-based adventure game.

Until next time,
~Yamahoshi

Report Abuse
Yamahoshi is not online. Yamahoshi
Joined: 26 May 2012
Total Posts: 215
14 Apr 2014 08:05 PM
bump :3
Report Abuse
Xision is not online. Xision
Joined: 16 Jul 2013
Total Posts: 51
14 Apr 2014 08:06 PM
good ol Jarvascript e.e
Report Abuse
AmethystKnight is not online. AmethystKnight
Joined: 08 Apr 2014
Total Posts: 36
14 Apr 2014 08:08 PM
It's pretty cool that people take the effort to make things like these. They don't get enough recognition from what I've seen, and people (especially newbies willing to learn) often take it for granted.
Report Abuse
Xision is not online. Xision
Joined: 16 Jul 2013
Total Posts: 51
14 Apr 2014 08:14 PM
Its great that you took your time to make this but... if someone wanted to learn about jarvascript they could just search the interwebs e.e.. There are 949,000,000 sources on jarvascript ya know ;-;
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