#how to check i a player is sneaking for 3 seconds

1 messages · Page 1 of 1 (latest)

junior jay
#

What’s your error and the problem, without any errors and with this big of a skritp people wont bother to help you need to explain more like what your trying to do and what you think is the problem

idle salmon
#

look i tell you

#
    player is sneaking
    if player's held item is {giantsword}:
        set {sneak::%player's uuid%} to now
        if the difference between {sneak::%player's uuid%} and now = 1 second:
            send action bar "&a&l▌" to player for 1 second
            wait 1 second
            if the difference between {sneak::%player's uuid%} and now = 2 second:
                send action bar "&a&l▌▌" to player for 1 second
                wait 1 second
                if the difference between {sneak::%player's uuid%} and now = 3 second:
                    send action bar "&a&l▌▌▌" to player for 1 second
                    wait 1 second
                    if the difference between {sneak::%player's uuid%} and now = 4 second:
                        send action bar "&a&l▌▌▌▌" to player for 1 second
                        wait 1 second
                        if the difference between {sneak::%player's uuid%} and now = 5 second:
                            send action bar "&a&l▌▌▌▌▌" to player for 5 second
                            set {giantablity::%player's uuid%} to true
                        ```
#

error : won't understand this condtion if the difference between {sneak::%player's uuid%} and now = 1 second:

junior jay
#

You don’t use = in skript use is

idle salmon
#

skript info

idle salmon
#

oh just is

junior jay
#

Yeah instead of =

#

You get confused with other languages I’m guessing it happens to me a lot

idle salmon
#

still eror

junior jay
#

Which is?

idle salmon
#

looki looki

#

do you kno why?

junior jay
#

Ok I think so set a new variable like this and check that var

set {_diff} to difference between {_var1} and {_var2}

#

Beacuse somethings with like if players tool is diamond with name “test”
Is funny like that as that don’t work when it should

idle salmon
#

i have a cool skript

#

do you talk about the giant sowrd?

#

sword

noble gate
#

I'll revise your Skript to fix errors and make it cleaner. It's a bit of a mess.

junior jay
idle salmon
#
  trigger:
    set {%arg%} to player's held item```
junior jay
#

But try what I said and do what vec said as well

#

Yeah I don’t need it I was just saying it’s like that

idle salmon
#

so first var1 is the {sneak::%player's uuid%} and second var is to set it to not

#

and to set {_diff} to the diffrence

#

?

junior jay
#

Ohh didn’t see your skript right one sec

idle salmon
#

lol

#

vec wirte smth too

#

i see you writing

junior jay
#

Somthing like this

set {_difference} to difference between {var-1} and now

#

And then check that variable

noble gate
#
on sneak toggle:
    if player is sneaking and player's held item is {giantsword}:
        set {sneak::%player's uuid%} to now
        wait 1 second
        if player is sneaking and player's held item is {giantsword}:
            send action bar "&a&l▌" to player for 1 second
            wait 1 second
            if player is sneaking and player's held item is {giantsword}:
                send action bar "&a&l▌▌" to player for 1 second
                wait 1 second
                if player is sneaking and player's held item is {giantsword}:
                    send action bar "&a&l▌▌▌" to player for 1 second
                    wait 1 second
                    if player is sneaking and player's held item is {giantsword}:
                        send action bar "&a&l▌▌▌▌" to player for 1 second
                        wait 1 second
                        if player is sneaking and player's held item is {giantsword}:
                            send action bar "&a&l▌▌▌▌▌" to player for 5 seconds
                            set {giantability::%player's uuid%} to true

Combined the player is sneaking and if player's held item is {giantsword} conditions into a single if statement to reduce redundancy and improve readability.

Removed the comparisons between {sneak::%player's uuid%} and now since the wait effects are used for delaying the action bar messages. Instead, I added extra conditions to check if the player is still sneaking and holding the {giantsword} item after each wait effect. This ensures that the ability activation process is interrupted if the player stops sneaking or switches items during the countdown.

Fixed a typo in the variable name giantablity to giantability.

idle salmon
#

first var {sneak::%player's uuid%} is set to now?

junior jay
#

So then why are you comparing it to now?

#

If it is now

idle salmon
#

@noble gate

#

it can't understand

noble gate
idle salmon
#

if player is sneaking and player's held item is {giantsword}:

noble gate
#

My fault, made a mistake in the syntax. Use if and and to combine the conditions properly.

junior jay
#

Gotta say you got lucky avocado not a lot of people would do that 😂

noble gate
#

😄

noble gate
#

Not a lot of people would spoon-feed.

#

Aka just send you the revised skript

idle salmon
#

ohhh

#

what is sponnfead?

#

like sending them the skript

#

and not making them do that

noble gate
idle salmon
#

oh

#

sorry

noble gate
#

No worries

idle salmon
#

thanks

#

like if player is sneaking and if player's held item is {giantsword}:?

noble gate
#

Are you making the server on Minehut?

#

Whitelist me: Skripters

idle salmon
#

how'd you know

noble gate
idle salmon
#

lol

#

look at the dm

#

the skript still isn't working