learngs2:whatjusthappened

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
learngs2:whatjusthappened [2023/02/24 12:12] twinnylearngs2:whatjusthappened [2023/02/24 12:23] (current) twinny
Line 2: Line 2:
  
 ====== What Just Happened ====== ====== What Just Happened ======
 +
 +Assuming everything just ran successfully, Graal took your script, compiled and executed it! Let's break it down:
 +
 +**__function onCreated __** - All code should be contained within functions that can be executed. onCreated is a default function that will be executed the first time the function is created. In our case, this is whenever we first create the weapon, update the weapon or if the server is restarted
 +
 +**__{ }  - __** We wrap all code within these curly braces. By putting all our code within function onCreated() { .... }  , it's saying that particular code belongs to the onCreated function. The code will only be executed if onCreated is called
 +
 +**__echo()  - __** This is an inbuilt Graal function that will print out the message that it is passed to it. For now, the message will be visible in the Remote Control chat window but this can differ
 +
 +__**"Hello, World!" - **__ This is the string value we passed to the echo() function to be printed. You could change this to any message you would like. It does not always need to be predefined text like this but we will come to that soon
 +
 +Again I really want to point out that you needn't worry if you aren't completely understanding everything right now. It should hopefully make more sense the more we play around with it!
  
  
  • learngs2/whatjusthappened.txt
  • Last modified: 2023/02/24 12:23
  • by twinny