I don't know how

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

just456

Member
Feb 8, 2020
2
0
1
20
Hello I don't know how to make specific players slighlty burn when they're under sunlight
[doublepost=1590421274,1589958398][/doublepost]:'(
 
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:
every 1 second:
    loop all players:
        set {_burn::%loop-player%} to true
        loop all blocks above loop-player:
            if loop-block is not air:
                delete {_burn::%loop-player%}
                stop 1 loop
        if {_burn::%loop-player%} is true:
            ignite the loop-player for 1 second
 
Last edited:
Try:
Code:
every 1 second:
    loop all players:
        if sunlight level at the loop-player is greater than 6:
            ignite the loop-player for 1 second
 
Last edited:
I'll just modify your code. I changed it to check the block above the player instead.
Code:
import:
    org.bukkit.block.Block
every 1 second:
    loop all players:
        set {_block} to block above loop-player
        if {_block}.getLightFromSky() > 11:
            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
 
Last edited:
I'm not sure if "air" can hold getLightFromSky correctly, also I found out that Skript has an expression for getLightFromSky.
[doublepost=1590532564,1590532445][/doublepost]Also, I don't think entities don't block sunlight,
actually the 11 should maybe be changed to 14 since the light level of the sky is 15
I thought the same thing but found out that zombies burn when it's 7 or above.
 
But standing under a block where the light level is set to 11 would make me burn
 
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.
 
Thanks for the help guys.
[doublepost=1591973459,1591973388][/doublepost]But is it possible to burn not all players, only players with special permission given through luckperms?
[doublepost=1591975433][/doublepost]This is my final code:
Code:
every 1 second:
    loop all players:
        if loop-player has permission "special.permission":
            if time in world "world" is between 5:00 and 18:30:
                if sunlight level at the loop-player is greater than 14:
                    ignite the loop-player for 1 second
 
Status
Not open for further replies.