Solved Keep players in the water from sinking

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

YK_DZ

Member
Jan 14, 2022
24
0
1
24
I want players in the water not to sink unless they hold their shift.
I have no clue about it. How should I achieve it?
 
I coded an off-brand Origins mod for my server which could not have real mods installed. I did this for Merling.
Code:
every tick:
    loop all players:
        if the block at loop-player is a water, a seagrass, a tall seagrass, a kelp or a kelp plant:
            set loop-player's gravity to off
        else:
            set loop-player's gravity to on
They will still sink in waterloged blocks tho.
 
I coded an off-brand Origins mod for my server which could not have real mods installed. I did this for Merling.
Code:
every tick:
    loop all players:
        if the block at loop-player is a water, a seagrass, a tall seagrass, a kelp or a kelp plant:
            set loop-player's gravity to off
        else:
            set loop-player's gravity to on
They will still sink in waterloged blocks tho.

Oh, I'm surprised.
In fact, I'm also writing a racial system which is similar to Origin mod for my server.
And thanks for your help, it worked!

By the way, I also add
.... bubble column or coral or coral fan:
So that players can not sink in more type of water! :emoji_slight_smile:
 
Last edited:
Status
Not open for further replies.