Difference between revisions of "Scripting Tutorial: My First Script"

no edit summary
imported>Tyrrael
imported>Tyrrael
Line 10: Line 10:
# A window will pop up with the item's properties. Where it says Script: NONE, click the 3 little dots next to it. This will open the Script Editor.
# A window will pop up with the item's properties. Where it says Script: NONE, click the 3 little dots next to it. This will open the Script Editor.
# Go to Script --> New, to start a new script.
# Go to Script --> New, to start a new script.
# Cut and paste the following:
# Cut and paste the following:<br><br>
#:ScriptName HelloWorld<br><br>
#:''ScriptName HelloWorld<br><br>''
#:Begin OnAdd
#:''Begin OnAdd''
#:Message "Hello World!", 10
#:''Message "Hello World!", 10''
#:end
#:''end''<br><br>
#:Info about the script itself:
#:- The first line is just the name of your script, and the last line of course ends the script.
#:- "Begin OnAdd" means that this script will fire each time you pick up this item.
#:- And lastly, the message line controls what will be displayed, with the "10" as how long the message will stay on screen. Check here for more info about the message command: [[Message]]
# Save the script and then close the Script Editor.
# Save the script and then close the Script Editor.
# Go back to the item properties and "HelloWorld" should appear as an option in the dropdown menu for Scripts. (You may have to close the item properties window and re-open it for the HelloWorld script to appear in the dropdown menu.)
# Go back to the item properties and "HelloWorld" should appear as an option in the dropdown menu for Scripts. (You may have to close the item properties window and re-open it for the HelloWorld script to appear in the dropdown menu.)
Anonymous user