Doug Posted June 2, 2020 Share Posted June 2, 2020 I was wondering how to make a command that gives items to all players on the server by typing the command in common event. Example: /giftallsword How would I setup my Common Command to gift all the sword by typing that command. Link to comment Share on other sites More sharing options...
1 Weylon Santana Posted June 4, 2020 Share Posted June 4, 2020 6 hours ago, defaultx said: Well give the item and set a player variable or even a self switch for that claim and toggle it. something like this.Variable Editor: (unique ID optional incase you need to call its value at a later date in a text box etc.) Event Example on map Prof of concept You could go further with this making seperate pages with spawn conditions using the variable if you dont want the npc to show after they claim the item etc. When you want to run a new claimable item make a new variable and update the event with the new variable to check. You can take this further with yes or no text boxes and other things, you can even go as far as using the system time in a variable to compare time differences etc for daily claims (all in ms btw) I would just like to make a correction to your script, the logic of the intersect has changed a little in 6.2. The "Set variable to true" should be the last command, below the message successful in chat. This is because when you set it to true, it goes out of the "if it is false" condition, so it doesn't reproduce the rest of the script. It has been like that in b6.2 Link to comment Share on other sites More sharing options...
2 Weylon Santana Posted June 3, 2020 Share Posted June 3, 2020 I find it a difficult question. Try to create 1 global variable. and 2 common events. In / command the event sets the variable to 1 or on. and the second event in autorun checks if the global variable is 1, and delivers the item and sets the variable to 0. BabyLoves 1 Link to comment Share on other sites More sharing options...
1 Gibier Posted June 4, 2020 Share Posted June 4, 2020 8 hours ago, Weylon Santana said: I would just like to make a correction to your script, the logic of the intersect has changed a little in 6.2. The "Set variable to true" should be the last command, below the message successful in chat. This is because when you set it to true, it goes out of the "if it is false" condition, so it doesn't reproduce the rest of the script. It has been like that in b6.2 You are right Weylon Santana 1 Link to comment Share on other sites More sharing options...
0 Doug Posted June 3, 2020 Author Share Posted June 3, 2020 @defaultxOH YEAHHHH A EVENT NPC! But how to refresh the event when I make a new event? To avoid it infinity rotating back to 0, Do I keep adding pages on or ? Link to comment Share on other sites More sharing options...
0 OniSensei Posted June 4, 2020 Share Posted June 4, 2020 17 hours ago, Doug said: @defaultxOH YEAHHHH A EVENT NPC! But how to refresh the event when I make a new event? To avoid it infinity rotating back to 0, Do I keep adding pages on or ? Well give the item and set a player variable or even a self switch for that claim and toggle it. something like this.Variable Editor: (unique ID optional incase you need to call its value at a later date in a text box etc.) Event Example on map Prof of concept You could go further with this making seperate pages with spawn conditions using the variable if you dont want the npc to show after they claim the item etc. When you want to run a new claimable item make a new variable and update the event with the new variable to check. You can take this further with yes or no text boxes and other things, you can even go as far as using the system time in a variable to compare time differences etc for daily claims (all in ms btw) Link to comment Share on other sites More sharing options...
0 Weylon Santana Posted June 4, 2020 Share Posted June 4, 2020 4 hours ago, defaultx said: If that were the case my prof of concept would not have worked (6.2 in the example). Changing a variable inside the result of the if statement does not effect the if statement, as the conditional branch has already done its check and moved on. I know that and used the scripts the way you said, but some stopped working when I changed the variable's place, it worked again. I don't remember if they were all in if or not, but I know, deciding to warn you, it's a small detail, but it can make a difference, since then it's always how I use it. Link to comment Share on other sites More sharing options...
0 Doug Posted June 7, 2020 Author Share Posted June 7, 2020 I'm make a Command, and players will be-able to type the command and once the claim it, they be stopped from spamming the command on claims. Whenever I release another item to everyone they be-able to do the command again and claim the item. /claim for Example, and I change the gifts overtime, and im also do this for Event Gifts and etc. Thank you guys for helping me big time! Link to comment Share on other sites More sharing options...
-1 OniSensei Posted June 3, 2020 Share Posted June 3, 2020 There are a couple ways to accomplish this and unfortunetly none are how you would want. You can make a /command for users to claim an item, or you can create an auto run even like weylon santana suggested, or create an npc that gives the item away and change it using the editor when you want it to go away, keep in mind that all these methods would need to leverage variables to toggle claims. But unfortunely you cant use a /command for a global give away like you would hope, at least not without source edits. Link to comment Share on other sites More sharing options...
-1 OniSensei Posted June 4, 2020 Share Posted June 4, 2020 3 hours ago, Weylon Santana said: I would just like to make a correction to your script, the logic of the intersect has changed a little in 6.2. The "Set variable to true" should be the last command, below the message successful in chat. This is because when you set it to true, it goes out of the "if it is false" condition, so it doesn't reproduce the rest of the script. It has been like that in b6.2 If that were the case my prof of concept would not have worked (6.2 in the example). Changing a variable inside the result of the if statement does not effect the if statement, as the conditional branch has already done its check and moved on. Link to comment Share on other sites More sharing options...
Question
Doug
I was wondering how to make a command that gives items to all players on the server by typing the command in common event.
Example: /giftallsword
How would I setup my Common Command to gift all the sword by typing that command.
Link to comment
Share on other sites
9 answers to this question
Recommended Posts