Help! • Heal Pool

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

Nikola

Member
Jul 10, 2019
38
1
8
Serbia
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."
 
PHP:
on region enter:
    "%region%" contains "king"
    set {.kothr.%player%} to true
on region leave:
    "%region%" contains "king"
    delete {.kothr.%player%}
on walking on gold block:
    {.kothr.%player%} is true
    {nospam::%player%} is not set
    set {nospam::%player%} to true
    apply regeneration 2 to player for 10 seconds # if it does not work, use this (execute console command "effect give %player% minecraft:regeneration 10")
    send "&8[&aKoTH ✪&8] &fApplied regeneration boost for &l10s&f."
    wait 10 seconds
    send "&8[&aKoTH ✪&8] &fRegeneration boost expired."
    delete {nospam::%player%}
on load:
    delete {nospam::*}
Not tested.
 
Status
Not open for further replies.