Im trying to make a fake experience bar that basically acts as a reload bar, or, say, a mana bar.
Basically, at standard the bar is full and when the player does a specific thing (e.g. cast a spell), the fake xp bar drains a little.
Now, the thing I'm not so sure about is how can I make it constantly recharge?
Most programming languages have a loop() or update() function though does denizen have something similar too? Or is there a different way
#(JustinS) fake experience bar that "reloads" constantly
48 messages ยท Page 1 of 1 (latest)
(JustinS) fake experience bar that "reloads" constantly
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
denizen has repeat, while, and foreach
or do you mean constantly like at all times?
if so, then you can use the delta time event
!e delta time
Group
Core
Event Lines
delta time hourly|minutely|secondly
Switches
every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).
Triggers
every <count> seconds, minutes, or hours of game calculation time. Default repetitions count of 1.
This is specifically based on the rate of time advancement in the game server,
which is not necessarily equivalent to the real passage of time (for example, this event may fire slower if the server is lagging).
For real time, see !event system time.
Context
<context.second> returns the exact delta time since system start.
secondly
on delta time secondly:
- repeat 20:
- ...
- wait 1t
this is better than using the on tick event, btw
@wicked dagger ping
yeah
then this
Ahh, and if I want it to just run once every second Id do:
on delta time secondly:
- script```
yea
๐
you could have a script running once every second, to check who, of all the players online, needs a "reload"
and then make that - run another script who will then have a tick per tick increase, so it's smoother
ie
on delta time secondly:
- foreach <server.online_players.filter[has_flag[...]]> as:player: #Or whatever other logic
- run script def.player:<[player]>
Wdym with "another script who will then have a tick per tick increase, so it's smoother"?
๐
Ill try it out. Ill leave this open for now because I'm 90% sure I'll run into an error regarding this lol
!t server.online_players_flagged
Returns a list of all online players with a specified flag set.
Can use "!<flag_name>" style to only return players *without* the flag.
Returns
ListTag(PlayerTag)
How can I prevent my logs from spasming out like in the video when using
on delta time secondly:
- repeat 20:
- ...
- wait 1t```
I added the debug:false though that doesnt change anything in the logs ๐
!debug
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
which is it supposed to be?
no longer override
Who knows what your script is doing