#help having trouble

1 messages · Page 1 of 1 (latest)

proper cloud
#

I'm sorry, what is this?? There's no way that's a valid event. Are you trying to define the loopSubtitle() function there?

Also, you can just send title x with subtitle y to all players

#

the thing above the hotbar is called an action bar

waxen smelt
proper cloud
#

i cant help you if you dont tell me what issue(s) you have

waxen smelt
#

oh wait 2 sec

waxen smelt
#

Mind helping me with this script ;-;

    loop all players:
        set {bubbles::%loop-player's uuid%} to 60

every tick:
    loop all players:
        if player is touching water:
            add 1 to {bubbles::%loop-player's uuid%}

every 20 ticks:  # This runs every 1 second
    loop all players:
        if player is touching water:
            if {bubbles::%loop-player's uuid%} > 0:
                remove 1 from {bubbles::%loop-player's uuid%}
                if {bubbles::%loop-player's uuid%} <= 0:
                    # Execute actions when bubbles run out (instant death example)
                    kill loop-player  # Kills the player instantly
                    send "&cYou drowned!" to loop-player

every 20 ticks:
    loop all players:
        send action bar "〘&aOxygen %{bubbles::%loop-player's uuid%}.s:bubbles:&8〙" to loop-player
#

got my friend to fix this

#

but it mesed up once i implemented touching water

#

and the action bar at the bottom

#

If im struggling with this cant wait to try the mining

#

Also forgot to say but thank you for your time

proper cloud
# waxen smelt Mind helping me with this script ;-; ```on load: loop all players: ...
  1. Stay away from looping players in periodicals, they're needlessly inefficient. In this case, its probably best to use on join and a while loop.
  • there's an on swim toggle: event, but that requires a player to be sprint-swimming, not just standing/walking in water
  1. no need to set the bubbles variable on load. Skript will treat non-set variables as 0, so you can still add and subtract.
  2. These variables don't need to be saved when the player is not on the server, so they should be a metadata tag (or memory variable)
  3. I think your logic is a little messed up here, you add 1 to the bubbles every tick, and then remove 1 every 20 ticks. Meaning they will always get +19, and will never drown.
  • also, what's wrong with the normal bubble meter?
  1. for the action bar, you forgot a %
waxen smelt
#

thanks

waxen smelt
proper cloud
#

i wont do it for you

#

if you tell me what parts youre stuck on I can elaborate

waxen smelt
proper cloud
#

(type of block at player's head location) = water will check if their head is in a water block

waxen smelt
#

thanks

waxen smelt
# proper cloud `(type of block at player's head location) = water` will check if their head is ...

i fixed the script it works now im now working on depth now the problem is it wont recognize the first line all others work

    trigger:
        set {_coord1} to arg-1  # First set of coordinates
        set {_coord2} to arg-2  # Second set of coordinates
        set {_depth} to arg-3  # Depth level
        
        # Parse coordinates
        set {_x1} to {_coord1::"%-10%" split " " as number}
        set {_y1} to {_coord1::"%-10%" split " " as number}
        set {_z1} to {_coord1::"%-10%" split " " as number}
        
        set {_x2} to {_coord2::"%-10%" split " " as number}
        set {_y2} to {_coord2::"%-10%" split " " as number}
        set {_z2} to {_coord2::"%-10%" split " " as number}
        
        loop blocks within {_x1}, {_y1}, {_z1}, {_x2}, {_y2}, {_z2}:
            set {_depthRegion} to loop-block
            set {_depthRegion} to "depth" with loop-block
        send "cordinate```
proper cloud
#

i dont think you can use location as an argument type

#

i guess you'll have to input each coord separately

waxen smelt
#

ah

#

also i have a pretty simple problem but i dont know how to fix it

#

my vanilla opxygen bar is going down too so i die from that before my other one is done how do i just make my normal oxygen bar not go down at all

    if {bubbles.%uuid of event-player%} is not set:
        set {bubbles.%uuid of event-player%} to 60  # Initialize bubbles to 60 for new players (representing 60 seconds)
    set {depth.%uuid of event-player%} to 0  # Initialize depth to 0 for new players

on quit:
    delete {bubbles.%uuid of event-player%}  # Clean up bubbles data when player quits
    delete {depth.%uuid of event-player%}  # Clean up depth data when player quits

every 20 ticks:  # Run every second
    loop all players:
        set {_headLocation} to location of loop-player's head
        set {_headBlock} to type of block at {_headLocation}
        if {_headBlock} is water:
            remove 1 from {bubbles.%uuid of loop-player%}  # Remove 1 bubble per second when head is in water
            if {bubbles.%uuid of loop-player%} < 0:
                set {bubbles.%uuid of loop-player%} to 0  # Ensure bubbles don't go below 0
            add 1 to {depth.%uuid of loop-player%}  # Increase depth by 1 when head is in water
        else:
            add 5 to {bubbles.%uuid of loop-player%}  # Add 5 bubbles per second when head is not in water
            if {bubbles.%uuid of loop-player%} > 60:
                set {bubbles.%uuid of loop-player%} to 60  # Cap bubbles at 60

every 20 ticks:
    loop all players:
        if {bubbles.%uuid of loop-player%} <= 0:
            kill loop-player  # Kills the player instantly when out of bubbles

every 20 ticks:
    loop all players:
        send action bar "&8〘&aOxygen %{bubbles.%uuid of loop-player%}%.s:bubbles:&8〙 | Depth: %{depth.%uuid of loop-player%}%.2f m &8〙" to loop-player
proper cloud