"on walking" does not work

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

BALTICA

New Member
Jun 7, 2021
7
0
1
50
I had been doing this script for a while and "on walking" didn't work.

I would like to know if there is any alternative to achieve the same task
and sorry for my bad english, i speak spanish

Code:
on walking:
    set {_distance} to distance between player and location 0, 0, 0
    set {_radiation} to 400 - {_distance}
    if {_radiation} < 0:
        stop
    else if {_radiation} < 150:
        stop
    else if {_radiation} < 300:
        set {_chance} to a random integer between 1 and 100
        if {_chance} is between 1 and 20:
            apply potion of nausea of tier 1 without particles to player for 10 seconds
    else if {_radiation} > 301:
        set {_chance} to a random integer between 1 and 100
        if {_chance} is between 1 and 20:
            apply potion of nausea of tier 1 without particles to player for 10 seconds
        if {_chance} is between 1 and 9:
            apply potion of wither of tier 1 without particles to player for 15 seconds
        if {_chance} is between 1 and 12:
            apply potion of blindness of tier 1 without particles to player for 15 seconds
 
This script is not recommended because it uses many resources, but I can't think of another solution rn, maybe loop all players and check if there are in a specific area
Code:
on any movement:
  set {_distance} to distance between player and location(0, 0, 0, world "WORLDNAME")
  set {_radiation} to 400 - {_distance}
  if {_radiation} is more than 300:
    set {_chance} to a random integer between 1 and 100
    if {_chance} is between 1 and 20:
      apply potion of nausea of tier 1 without particles to player for 10 seconds
  else if {_radiation} is less than 300:
    set {_chance} to a random integer between 1 and 100
    if {_chance} is between 1 and 20:
      apply potion of nausea of tier 1 without particles to player for 10 seconds
    if {_chance} is between 1 and 9:
      apply potion of wither of tier 1 without particles to player for 15 seconds
    if {_chance} is between 1 and 12:
      apply potion of blindness of tier 1 without particles to player for 15 seconds
 
Status
Not open for further replies.