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.

I don't know how

Discussion in 'Skript' started by just456, May 20, 2020.

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

    just456 Member

    Joined:
    Feb 8, 2020
    Messages:
    2
    Likes Received:
    0
    Hello I don't know how to make specific players slighlty burn when they're under sunlight
    --- Double Post Merged, May 25, 2020, Original Post Date: May 20, 2020 ---
    :'(
     
  2. WeeHee

    WeeHee Active Member

    Joined:
    Mar 4, 2017
    Messages:
    108
    Likes Received:
    21
    I believe it's going to lag a lot if there are many players online. If it does, then you could change the number in "every 1 second" to something higher.

    Code (Text):
    1. every 1 second:
    2.     loop all players:
    3.         set {_burn::%loop-player%} to true
    4.         loop all blocks above loop-player:
    5.             if loop-block is not air:
    6.                 delete {_burn::%loop-player%}
    7.                 stop 1 loop
    8.         if {_burn::%loop-player%} is true:
    9.             ignite the loop-player for 1 second
     
    #2 WeeHee, May 25, 2020
    Last edited: May 26, 2020
  3. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    Try:
    Code (Text):
    1. every 1 second:
    2.     loop all players:
    3.         if sunlight level at the loop-player is greater than 6:
    4.             ignite the loop-player for 1 second
     
    #3 rustedst, May 26, 2020
    Last edited: May 26, 2020
  4. WeeHee

    WeeHee Active Member

    Joined:
    Mar 4, 2017
    Messages:
    108
    Likes Received:
    21
    I'll just modify your code. I changed it to check the block above the player instead.
    Code (Text):
    1. import:
    2.     org.bukkit.block.Block
    3. every 1 second:
    4.     loop all players:
    5.         set {_block} to block above loop-player
    6.         if {_block}.getLightFromSky() > 11:
    7.             ignite the loop-player for 1 second
    actually the 11 should maybe be changed to 14 since the light level of the sky is 15
     
    #4 WeeHee, May 26, 2020
    Last edited: May 26, 2020
  5. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    I'm not sure if "air" can hold getLightFromSky correctly, also I found out that Skript has an expression for getLightFromSky.
    --- Double Post Merged, May 26, 2020, Original Post Date: May 26, 2020 ---
    Also, I don't think entities don't block sunlight,
    I thought the same thing but found out that zombies burn when it's 7 or above.
     
  6. WeeHee

    WeeHee Active Member

    Joined:
    Mar 4, 2017
    Messages:
    108
    Likes Received:
    21
    But standing under a block where the light level is set to 11 would make me burn
     
  7. rustedst

    rustedst Active Member

    Joined:
    Apr 24, 2020
    Messages:
    97
    Likes Received:
    4
    It takes "sunlight", so since sunlight doesn't only come from the top with 90°, you can take it from other directions, which makes it more realistic in my opinion.
     
  8. just456

    just456 Member

    Joined:
    Feb 8, 2020
    Messages:
    2
    Likes Received:
    0
    Thanks for the help guys.
    --- Double Post Merged, Jun 12, 2020, Original Post Date: Jun 12, 2020 ---
    But is it possible to burn not all players, only players with special permission given through luckperms?
    --- Double Post Merged, Jun 12, 2020 ---
    This is my final code:
    Code (Text):
    1. every 1 second:
    2.     loop all players:
    3.         if loop-player has permission "special.permission":
    4.             if time in world "world" is between 5:00 and 18:30:
    5.                 if sunlight level at the loop-player is greater than 14:
    6.                     ignite the loop-player for 1 second
     
Thread Status:
Not open for further replies.

Share This Page

Loading...