Offline Votes

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Reframed

Member
Mar 8, 2017
11
0
0
26
Skript Version: Skript 2.2 (dev29)
Skript Author: Bensku
Minecraft Version: 1.11.2

I am currently attempting to execute a command even if the player who voted is offline but skript is sending me this in console:
e866438e8e27cc9265fe80bf3012d98f.png

This is my code:
Code:
on offline vote:
    broadcast "test"
 
Is this an error? It wouldn't do any good to give them, for instance, an item if they weren't online because they wouldn't be there to receive it. Also wouldn't it be easier to just require the player to be online or they just miss out on rewards? Sorry if I'm wrong <3
 
Is this an error? It wouldn't do any good to give them, for instance, an item if they weren't online because they wouldn't be there to receive it. Also wouldn't it be easier to just require the player to be online or they just miss out on rewards? Sorry if I'm wrong <3
I am not attempting to give rewards, they will be given via a proper listener. This is just for setting the cooldown since it will only activate once they join, so the cooldown could start once they already voted. It technically isn't an error since it is getting the votes but not executing broadcast (which it will do if player comes online)
 
Any idea on how to fix this?
Uhm, do i understand correctly?

you are using this events?:

code_language.skript:
On vote:
 #Bla

even, if a player is not online, You get the console spam? SO its mean, You should this saved into variables, like this

code_language.skript:
on vote:
    if event-player is online:
      #Todo
    else:
        set {Vote::%event-player%} to true

on join:
    if {Vote::%player%} is set:
        delete {Vote::%player%}
        send "Thanks for voting!"
        #Give stuff
 
Uhm, do i understand correctly?

you are using this events?:

code_language.skript:
On vote:
 #Bla

even, if a player is not online, You get the console spam? SO its mean, You should this saved into variables, like this

code_language.skript:
on vote:
    if event-player is online:
      #Todo
    else:
        set {Vote::%event-player%} to true

on join:
    if {Vote::%player%} is set:
        delete {Vote::%player%}
        send "Thanks for voting!"
        #Give stuff
No this is not the issue. It sends this message only once if the player is offline to let me know that it saved the player and everything will be executed once they join. I am trying to run something if the player is offline (which does not work) to make my skript work correctly
 

I've never messed with the on vote event, and don't personally know how it works, so my question is: does the event even fire if the voting player is offline, or does it catch it before and just not run?

If it doesn't fire at all, you may be out of luck, and may have to use an external voting listener.

If it does fire, maybe something like this may work:

code_language.skript:
on vote:
    set {_player} to "%player%" parsed as offline-player
    if {_player} is not online:
        broadcast "%{_player}% is not currently online!"
 
Status
Not open for further replies.