Help with periodic skript

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

Meatball

New Member
Mar 22, 2020
8
0
0
19
how can i check if a player is online every so often and then with that information change the effect of something.
Code:
every 100 ticks
  if player is online:
   #code
  else:
   stop
I know that you can not use every 100 ticks like this i just used this to show what i am trying to do.
 
1. Save the player in a variable (Not in the every trigger)

2. In the every trigger replace "player" with your variable

I do have the player saved as a variable, still doesn't work
[doublepost=1587923852,1587923711][/doublepost]here is the exact code i am trying to use, right now it only checks once if the player is online, as i have the if player is online before every 100 ticks.
Code:
on place of dried kelp block:
  set {owner::%uuid of player%} to player
  if {maxgen::%uuid of player%} is not set:
    set {maxgen::%uuid of player%} to 15
  if {gen::%uuid of player%} >= {maxgen::%uuid of player%}:
    cancel event
    send "&cYou already placed max generators"
  if {gen::%uuid of player%} < {maxgen::%uuid of player%}:
    add 1 to {gen::%uuid of player%}
    send "&7You have placed &c%{gen::%uuid of player%}%&7/&c%{maxgen::%uuid of player%}% &7generators"
  if {owner::%uuid of player%} is online:
    while event-block is dried kelp block:
      wait 100 ticks
      drop 1 kelp above location of event-block
  else:
    stop
but i would like it to check if the player is online every minute then if the player is online it continues with the code.
 
@Meatball
As I have understod, you just want to check if a player is online, correct?

If so, then simply do as you did
Code:
if player is online:
    code
 
Status
Not open for further replies.