1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help! • Heal Pool

Discussion in 'Skript' started by Nikola, Jul 25, 2019.

Thread Status:
Not open for further replies.
  1. Nikola

    Nikola Member

    Joined:
    Jul 10, 2019
    Messages:
    38
    Likes Received:
    1
    Hi guys, I tried to make heal pool in my factions koth region. My idea is:
    • Check if player is in worldguard region "KingOfTheHill"
    • If he/she is, check if player is standing on GOLD BLOCK.
    • If player is standing on gold, give him potion effect
    • I have one issue - I used string "ON WALKING ON <BLOCK>", which means that player can walk on gold block and get regeneration effect every time he walks on it. How do I make cooldown, or something like that which will not allow them to get effect times? Is there any other string, like - ON STANDING ON BLOCK, or something like that?
    • SKRIPT:
    on region enter:
    if "%event-region%" contains "king":
    set {.kothr.%player%} to true

    on region leave:
    if "%event-region%" contains "king":
    set {.kothr.%player%} to false

    on walking on gold block:
    if {.kothr.%player%} is true:
    apply regeneration 2 to player for 10 seconds
    send "&8[&aKoTH ✪&8] &fApplied regeneration boost for &l10s&f."
    wait 10 seconds
    send "&8[&aKoTH ✪&8] &fRegeneration boost expired."
     
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    314
    Likes Received:
    21
    Code (Text):
    1. on walking on gold block:
    2.     if {.kothr.%player%} is true:
    3.       set {using_boost.%player%} to true
    4.         if {using_boost.%player%} is false:
    5.           apply regeneration 2 to player for 10 seconds
    6.           send "&8[&aKoTH ✪&8] &fApplied regeneration boost for &l10s&f."
    7.           wait 10 seconds
    8.           set {using_boost.%player%} to false
    9.           send "&8[&aKoTH ✪&8] &fRegeneration boost expired."
    Not tested but should work

    edit: you want a cooldown isn't it?
     
  3. KingAdmin_YT

    KingAdmin_YT Member

    Joined:
    May 16, 2018
    Messages:
    27
    Likes Received:
    0
    PHP:
    1. on region enter:
    2.     "%region%" contains "king"
    3.     set {.kothr.%player%} to true
    4. on region leave:
    5.     "%region%" contains "king"
    6.     delete {.kothr.%player%}
    7. on walking on gold block:
    8.     {.kothr.%player%} is true
    9.     {nospam::%player%} is not set
    10.     set {nospam::%player%} to true
    11.     apply regeneration 2 to player for 10 seconds # if it does not work, use this (execute console command "effect give %player% minecraft:regeneration 10")
    12.    send "&8[&aKoTH ✪&8] &fApplied regeneration boost for &l10s&f."
    13.     wait 10 seconds
    14.     send "&8[&aKoTH ✪&8] &fRegeneration boost expired."
    15.     delete {nospam::%player%}
    16. on load:
    17.     delete {nospam::*}
    Not tested.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...