Script Idea - Tax and Thieves System


Jul 10, 2021
I'm not sure if this is the right place to do this but it seemed like a fitting forum for it so I'm giving it a go. If I'm in the wrong place. please feel free to move it or remove as necessary. I'm very new to Denizen scripting. I have some of my first scripts up and running on my server but they are just basic, beginner type stuff obviously. But, I want to take it to the next level and try something a bit more complicated. Complicated from my perspective, not necessarily complicated for some of you scripting veterans out there. I've had some flaws in the economy system on my server which some enterprising players were able to exploit and become super rich in a short period of time, which of course throws the whole economy out of balance. I've taken care of these issues but rather than take their money away directly, what I would like to implement is a world script that does something along these lines.

1. About every hour or so, it will pick a random player. Whether online or off, and check their money balance.
2. If that player's money balance is over a certain threshold it will take somewhere between, say, 4% to 12% of their balance.
3. Either through narrate or a message which they will receive when they log back on they will be told either, "Thieves have broken in and stolen $<moneytaken> from your account!" or "You've had a visit from the tax collector and $<moneytaken> has been forfeited from your account to pay your taxes."

Now, I'm not asking anyone to spoon feed me a ready made script to do this. I want to use it as a learning experience for myself. But, I would appreciate it if someone who has more experience could give me a basic outline of how I would want to go about accomplishing this. What tags should I be looking up? How do I affect offline players accounts and send them messages? Things like that. Anyway, I appreciate any help anyone is willing to give me on this and thanks for all that you do!


Staff member
- "About every hour or so," time
- "pick a random player" and
- "check their money balance"
You can literally just type "players" and "money" and whatever into the search to find these... most things are findable with a keyword search or two

2: if command, ".mul[0.04]" for the percentrage, ...

3: ... yep narrate yep

If you haven't already, follow the guide @ to learn basic concepts like if commands and definitions which you'll need for that

"How do I affect offline players accounts" same way as you do online players
"and send them messages" if offline, store the notice in a player flag, and use something like "after player joins flagged:notifications:" with a narrate to show the message and clear the flag (or maybe a "You have notifications! Type /notifications to read them" to avoid the player missing them)
  • Like
Reactions: Andarius68