Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
learngs2:helloworld [2022/06/09 02:28] – twinny | learngs2:helloworld [2023/02/24 12:12] (current) – twinny | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <- start ^ start ^ variables -> | + | << start ^ start ^ whatjusthappened >> |
- | ===== Hello World! (Start Here) ===== | + | ====== Hello World ====== |
Whenever you learn a new language, the first step is often to perform what is known as a "Hello World": | Whenever you learn a new language, the first step is often to perform what is known as a "Hello World": | ||
- | The code looks like this. Don't worry if you don't understand what any of these lines mean right now: we will come back to that! | + | The code looks like this: |
<code javascript> | <code javascript> | ||
function onCreated() { | function onCreated() { | ||
- | echo(" | + | echo(" |
} | } | ||
+ | |||
+ | |||
</ | </ | ||
+ | |||
+ | Don't worry if none if this makes sense right now: we will dive into all aspects as we go. For now, we can under stand that the moment this NPC is created, it will print " | ||
+ | |||
+ | First, we will hit the ' | ||
+ | |||
+ | This will open a list of all the current Weapons in the server. For Testbed, this will be a lot. | ||
+ | |||
+ | // | ||
+ | |||
+ | From here, we want to press the ' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | When you hit OK, it will open a new window where you can create your weapon but it hasn't done so yet. It will only do so when you hit Apply. For now, enter the code as provided above: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Hit Apply and hopefully you will successfully create your first script and see the output in RC! | ||
+ | |||
+ | {{: | ||
+ | |||
+ | You've made your first successful script…hopefully! If you didn't see ' | ||
+ | |||
+ | < | ||
+ | Twinny prob: No write rights for WEAPONS/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | This is telling me I don't actually have rights to create a weapon with this name. If you see something like this, you will need to check your rights to confirm what weapons you can create (if any). [TODO: elaborate] | ||
+ | |||
+ | If you have been successful, we can move on! Let's go! | ||
+ | |||
+ |