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.

detect chunk issue?

Discussion in 'Skript' started by FallingCatus, Mar 29, 2019.

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

    FallingCatus Member

    Joined:
    Jun 29, 2017
    Messages:
    38
    Likes Received:
    0
    Hey all,
    I'm having a issue, no errors showing but with this skript it doesn't seem to set only the event blocks chunk as true but instead sets others around it? but the event chunk doesn't seem to be set, its weird. i have sent full code so you guys can test and hopefully help me out here.
    what i am going for...
    When player enters chunk and chunk has the block in it, player gets effects removed and when they leave that chunk (enter another) effects are then given back depending on world.
    probs worth saying that by default players all have jump and slow falling be default and this block removes those effects when in chunk the block is in.

    Thanks


    Code (Text):
    1.  
    2. options:
    3.     block: light gray glazed terracotta
    4.     name: "&b&lGravity Generator"
    5.     lore: "&7This item restores &2Earth &7like gravity."
    6.     giveperm: cosmic.owner
    7.  
    8. on block place of {@block}:
    9.     if the 1st line of the tool's lore is {@lore}:
    10.         set {block.cosmicgravity::%event-block's location%} to true
    11.         set {chunk.cosmicgravity::%event-block's chunk%} to true
    12.         send "&dCosmic &8» &b&lGravity Generator &7has been placed." to player
    13.         stop
    14.  
    15. on block break of {@block}:
    16.     if {block.cosmicgravity::%event-block's location%} is true:
    17.         if {chunk.cosmicgravity::%event-block's chunk%} is true:
    18.             drop {@block} named {@name} with lore {@lore} at location of event-block
    19.             send "&dCosmic &8» &b&lGravity Generator &7has been removed." to player
    20.             set event-block to air
    21.             cancel event
    22.             set {block.cosmicgravity::%event-block's location%} to false
    23.             set {chunk.cosmicgravity::%event-block's chunk%} to false
    24.             stop
    25.  
    26. on chunk enter:
    27.     if {chunk.cosmicgravity::%event-player's chunk%} is true:
    28.         send "&a&lBlock in the is chunk." to player
    29.         remove slow falling from player
    30.         remove jump boost from player
    31.         stop
    32.     if {chunk.cosmicgravity::%event-player's chunk%} is false:
    33.         player is in "Moon":
    34.             send "no block" to player
    35.             apply potion of slow falling of tier 4 without any particles to the player for 1 day
    36.             apply potion of jump boost of tier 4 without any particles to the player for 1 day
    37.             stop
    38.         player is in "world":
    39.             send "&c&lBlock not in this chunk." to player
    40.             apply potion of slow falling of tier 1 without any particles to the player for 1 day
    41.             apply potion of jump boost of tier 2 without any particles to the player for 1 day
    42.             stop
    43.         player is in "world_nether":
    44.             send "no block" to player
    45.             apply potion of slow falling of tier 1 without any particles to the player for 1 day
    46.             apply potion of jump boost of tier 2 without any particles to the player for 1 day
    47.             stop
    48.         player is in "k2":
    49.             send "no block" to player
    50.             apply potion of slow falling of tier 2 without any particles to the player for 1 day
    51.             apply potion of jump boost of tier 3 without any particles to the player for 1 day
    52.             stop
    53.  
    54. command /giveitem [<player>]:
    55.     trigger:
    56.         if player has permission "{@giveperm}":
    57.             if arg 1 is not set:
    58.                 give player 1 {@block} named {@name} with lore {@lore}
    59.                 send "&dCosmic &8» &7You have been given a &b&lGravity Generator&7." to player
    60.                 stop
    61.             if arg 1 is set:
    62.                 give arg 1 {@block} named {@name} with lore {@lore}
    63.                 send "&dCosmic &8» &7You have been given a &b&lGravity Generator&7." to arg
    64.                 stop
    65.  
    66.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...