When owner online do action

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

chisha

Member
Nov 4, 2023
1
0
1
24
Category: specified player online

Suggested name: on

Spigot/Skript Version: 2.7.1

What I want:

when owner is online 1)place a block on x y z 2) wait 1s 3)then place air x,y,z and loop it every 15 mins

Ideas for commands: just setblock i think

Ideas for permissions: need to be op'ed lol


When I'd like it by: please if u know how to do this, when u will have some free time :>
 
Category: specified player online

Suggested name: on

Spigot/Skript Version: 2.7.1

What I want:

when owner is online 1)place a block on x y z 2) wait 1s 3)then place air x,y,z and loop it every 15 mins

Ideas for commands: just setblock i think

Ideas for permissions: need to be op'ed lol


When I'd like it by: please if u know how to do this, when u will have some free time :>

How would we (as the coder) know who the owner is?
 
  • Like
Reactions: chisha
Category: specified player online

Suggested name: on

Spigot/Skript Version: 2.7.1

What I want:

when owner is online 1)place a block on x y z 2) wait 1s 3)then place air x,y,z and loop it every 15 mins

Ideas for commands: just setblock i think

Ideas for permissions: need to be op'ed lol


When I'd like it by: please if u know how to do this, when u will have some free time :>

As I understand, you want every 15 minutes set a block in XYZ coordinates and a second later replace it to air, only if the owner is online. Just make sure to:
- Replace "WORLD_HERE" with your world's name.
- Replace "OWNER_NICKNAME" with the owner's username.
- Replace the coordinates where "50, 50, 50" with the one you want.
- Replace the dirt block with the one you want.
Code:
every 15 minutes in "WORLD_HERE":
    if "OWNER_USERNAME" is online:
        set block at location at 50, 50, 50 in world "WORLD_HERE" to dirt
        wait 1 second
        set block at location at 50, 50, 50 in world "WORLD_HERE" to air
 
  • Like
Reactions: chisha
As I understand, you want every 15 minutes set a block in XYZ coordinates and a second later replace it to air, only if the owner is online. Just make sure to:
- Replace "WORLD_HERE" with your world's name.
- Replace "OWNER_NICKNAME" with the owner's username.
- Replace the coordinates where "50, 50, 50" with the one you want.
- Replace the dirt block with the one you want.
Code:
every 15 minutes in "WORLD_HERE":
    if "OWNER_USERNAME" is online:
        set block at location at 50, 50, 50 in world "WORLD_HERE" to dirt
        wait 1 second
        set block at location at 50, 50, 50 in world "WORLD_HERE" to air
wouldn't you have to parse the string as an offlineplayer?
 
  • Like
Reactions: chisha
wouldn't you have to parse the string as an offlineplayer?
It worked for me, if there's any issues just use this code:
Code:
every 15 minutes in "WORLD_HERE":
    if "OWNER_USERNAME" parsed as player is online:
        set block at location at 0, 105, 0 in world "Lobby" to dirt
        wait 1 second
        set block at location at 0, 105, 0 in world "Lobby" to air
 
Last edited:
  • Love
Reactions: chisha
It worked for me, if there's any issues just use this code:
Code:
every second in "WORLD_HERE":
    if "OWNER_USERNAME" parsed as player is online:
        set block at location at 0, 105, 0 in world "Lobby" to dirt
        wait 1 second
        set block at location at 0, 105, 0 in world "Lobby" to air
(pretty sure you meant every 15 minutes in line 1)
 
  • Like
Reactions: chisha