#How Can I do this

1 messages · Page 1 of 1 (latest)

languid cedar
#

Hey so in my code I am making a custom mace that does things after a amount of hits 1st does a bit more damage 2nd does a auto stun slam and 3rd does a grapple i have the first and 3rd one working but i cant do the stun slam one i am trying to make it so when a player hits a shield if they are in air and its a mace hit it disables the shield then does a mace slam thingy that would do the same amount as a density 5 mace then also launch the player back up but i am having trouble doing this

karmic obsidian
languid cedar
#

okay give me a sec

#

else if {_stage} is 2:
if victim is a player:
set {_vp} to victim parsed as player

    if victim is blocking with a shield:
        set item cooldown of shield for {_vp} to 10 seconds

        set damage to damage * 1.6

        mace smash attack effect using 50 particles at victim's location
        wind burst effect level 1 using 5 density at victim's location

        thrust attacker upwards with force 1.5

        draw 25 of block_crumble using white stained glass pane at victim's location with delta vector 0.3, 0.2, 0.3 with extra 1 with force
        draw 10 of crit at victim's location with extra 0.3

        play sound "minecraft:item.mace.smash_ground_heavy" with volume 1 and pitch 0.9 to all players in radius 20 of victim
        play sound "minecraft:item.shield.break" with volume 1 and pitch 1.0 to all players in radius 20 of victim

        send actionbar "&c&lSHIELD BROKEN!" to {_vp}
    else if victim is not blocking with a shield:
        set damage to damage * 1.4
        nukozStageTwoParticles(victim's location)

else:
    set damage to damage * 1.4
    nukozStageTwoParticles(victim's location)

nukozShowActionBar(attacker)
karmic obsidian
languid cedar
#

@karmic obsidian

#

wdm formate

#

format*

#

like the file?

daring domeBOT
#

twisted suggests that you read this embed

Formatting Code In Discord
Why?

Code blocks make it easier for helpers to identify potential errors -- help them help you!

The Format

```vb
on chat:
broadcast "This is how you format code!"
```

How It Looks
on chat:
    broadcast "This is how you format code!"
Extra Info

On US keyboards, the grave character (`) is located above the tab key on the top left of the keyboard

languid cedar
#

o ok

#

Idkkk

#

uh

#

wait

karmic obsidian
#

oh my god

languid cedar
#
    if victim is a player:
        set {_vp} to victim parsed as player

        if victim is blocking with a shield:
            set item cooldown of shield for {_vp} to 10 seconds

            set damage to damage * 1.6

            mace smash attack effect using 50 particles at victim's location
            wind burst effect level 1 using 5 density at victim's location

            thrust attacker upwards with force 1.5

            draw 25 of block_crumble using white stained glass pane at victim's location with delta vector 0.3, 0.2, 0.3 with extra 1 with force
            draw 10 of crit at victim's location with extra 0.3

            play sound "minecraft:item.mace.smash_ground_heavy" with volume 1 and pitch 0.9 to all players in radius 20 of victim
            play sound "minecraft:item.shield.break" with volume 1 and pitch 1.0 to all players in radius 20 of victim

            send actionbar "&c&lSHIELD BROKEN!" to {_vp}
        else if victim is not blocking with a shield:
            set damage to damage * 1.4
            nukozStageTwoParticles(victim's location)

    else:
        set damage to damage * 1.4
        nukozStageTwoParticles(victim's location)

    nukozShowActionBar(attacker)```
karmic obsidian
#

it’s a backtick not a quote

languid cedar
#

got it

#

that was hard

worldly crystal
#

So uh, why do we set {_vp} when we can (and do!) use the victim expression?

#

parsing here is also very bad, its slower and... guess what? the victim is already a player

languid cedar
#

idk gng i am not very good

karmic obsidian
#

victim parsed as player
are we kidding

languid cedar
#

idk 😭

karmic obsidian
#

is this ai?

languid cedar
#

i am confused and havent sleept in like a day

languid cedar
#

i was getting help from a friend and he sent that

#

and it still didnt work

worldly crystal
#

well from this, no offense, but it doesnt look like your friend is very good at skript

languid cedar
#

he isnt

#

neither am i

worldly crystal
#

its probably a better idea for you to put in a bit of practice and learn some skript than use their code

languid cedar
#

well i have learnt a bit

#

but i couldnt get it to work

#

so i jst asked them

#

then they changed like all my code

#

i do know how to but i am jst very sleep deprieved and i need to finsh this

#

anyways can you help me or not/

#

?

worldly crystal
#

well you would need to detail the issues with your code here, past "I am having trouble doing this"

languid cedar
#

okay i will then

#

basically i am trying to make it so if you have a mace then you get to the 2nd stage aka the instant stun slam when you mace hit a players shield the shield gets disabled for the amount of time as a axe would disable it then the enemy also gets hit by a density 5 mace hit

worldly crystal
#

yes, you mentioned that.

languid cedar
#

but currently it isnt doing that and jst playing the sounds but not disabling anything

worldly crystal
#

any errors? cause I cant seem to find a mace smash effect on the docs..

languid cedar
#

the victim parsed as player

worldly crystal
#

Uh yeah

pallid bison
#
  1. victim should already be a player.
  2. You have skript-reflect, right? And imported the correct classes?
  3. That's made-up syntax. it needs play or show, and needs you to actually look at the examples
worldly crystal
#

those would have neen good to mention at the start

languid cedar
#

o

#

is the problem set _vp} to victim parsed as player

worldly crystal
#

thats a problem, yes

#

as i think was mentioned 3x now

languid cedar
#

😭

#

i have been working on this for like 3 hours straight

#

trying to fix it

worldly crystal
#

you do not need a variable there at all

languid cedar
#

the whole victim thing

worldly crystal
worldly crystal
languid cedar
#

ok

#

so my friend used ai and wasted my time?

pallid bison
#

hate to say it, but probably

languid cedar
#

okay

worldly crystal
languid cedar
#

i am gonna slime him out if it works

#

it does

#

but there is 1 problem

#

it disables the shield but doesnt put it down

worldly crystal
#

I dont think theres a way to force a player to stop blocking, unless there's some reflect/packet wizardry.
as a work around, you could potentially set that slot to air, and back to a shield a tick later

languid cedar
#

okay i will do that

#

thanks

bright terraceBOT
# languid cedar thanks

Consider increasing someone's reputation with </reputation increase:1458495875985969212> if you found them to be helpful!

worldly crystal
#

afaik you can only prevent future blocks, not disable a current one

bright terraceBOT
#

You successfully increased @worldly crystal's reputation. They now have 3 skoints!

worldly crystal
#

a few things;

  1. use (index of (victim's current hotbar slot)) to get the slot the sheild is in (might also be their offhand)
  2. set a local variable to the shield, so you can replace it with exactly the same item
  3. set the slot from #1 to air, wait a tick, set slot from #1 to var from #2
languid cedar
#

alr will do thanks

fair rock
languid cedar
bright terraceBOT
fair rock