Jump to content

How to add items to a player through a terminal?


1anonymous25

Recommended Posts

The "AddItem" function has two flags. The first of which specifies how many items you want to add. You've left it blank, which, I assume, means that it will add zero. Try adding a one to the end of each function and it ought to work! :) Edited by Jojash
Link to comment
Share on other sites

The easiest way to do this is to add a global variable into the mix. This is pretty simple to set up, just select "Gameplay" in the main toolbar and then click on "Globals...". From here, right-click and select "new". Then type in the name of your global variable. For the sake of this example, I'll be calling it "ExampleGlobal".

 

Once you've made the global variable, go to your terminal and go to the button that you wish to make only work once. Right-click in the "conditions" box and then find the option that says "GetGlobalValue" then, in the "functions" box, select the global variable that you've made. Now, in the "value" box, change the value to "0", then click "OK".

 

Now, you need to change the value of the global variable when the user selects one of the options. Add in the line "Set ExampleGlobal to 1" after your last function. Obviously, you'll have named your global something other than "ExampleGlobal", so just substitute that in. Finally, you'll have to check the box next to "Force Redraw".

 

If you want to make this happen with both options, you have a choice. You can either make it so that you can select both options once, or only one option once. If you want to do the latter then copy the condition you made for this button and paste it into the conditions box of the other button. For the former, you'll need to repeat this process with that button, but you'll need a separate global.

Edited by Jojash
Link to comment
Share on other sites

That's not easier then using a one time use variable unless I'm missing something

No, it's a little harder, but I don't think you can use the variables in a condition for the terminal in the same way. Using the variables as you're suggesting would mean leaving the button there, which would be a little confusing. Perhaps I should have said neater as opposed to easier...

 

Of course I could be totally wrong, and if I am, feel free to correct me! :smile:

Edited by Jojash
Link to comment
Share on other sites

Ya sorry, forgot you cant declare variables in terminals. So it is probably the easiest way.

Actually, you can. However, variables declared in result script boxes cannot be used in conditions, therefore will not be suitable here.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...