Jump to content
  • 0

Global Common Event Help Needed


Doug

Question

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

  • 1
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:
dbef930dcc59bb9a60c5379c8af5bf97.png

(unique ID optional incase you need to call its value at a later date in a text box etc.)
 

Event
f4f2a8a6917d4f2dcd8d6444814339d6.png

Example on map
e9bd026a912c7e3d1b6966ce11274301.png

Prof of concept
e09e182cad370e2dab88f6cf1248940d.png


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

  • 1
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

Link to comment
Share on other sites

  • 0
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:
dbef930dcc59bb9a60c5379c8af5bf97.png

(unique ID optional incase you need to call its value at a later date in a text box etc.)
 

Event
f4f2a8a6917d4f2dcd8d6444814339d6.png

Example on map
e9bd026a912c7e3d1b6966ce11274301.png

Prof of concept
e09e182cad370e2dab88f6cf1248940d.png


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

  • 0
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

  • 0

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

  • -1

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

  • -1
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

×
×
  • Create New...