My skript not working, but successfully loaded! (part 2)

  • 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 community!

    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!

nicnicnic

Member
Oct 15, 2023
3
0
1
Can someone help me with this! I want to make my netherite sword charge by swap the sword to offhand, when it is done charging, it switch back to mainhand, which is charge false. And with some particle and effect. Idk why, it's not working.

on swap hand item:
if event-player's offhand tool is a netherite sword:
set {netherite_sword::charging} to true
if {netherite_sword::charging} is true:
wait 1 second
add 1 to {netherite_sword::charge-level}
wait 1 second
add 1 to {netherite_sword::charge-level}
wait 1 second
add 1 to {netherite_sword::charge-level}
wait 1 second
add 1 to {netherite_sword::charge-level}
set {netherite_sword::charge-level} to 0
if {netherite_sword::charge-level} is 1:
make console execute "/execute at %player% run particle flame ~ ~ ~ 1 0 1 0 50"
apply slowness potion of tier 255 without particles to player for 4 seconds
else if {netherite_sword::charge-level} is 2:
make console execute "/execute at %player% run particle landing_lava ~ ~ ~ 1.5 0 1.5 0 100"
else if {netherite_sword::charge-level} is 3:
make console execute "/execute at %player% run particle falling_obsidian_tear ~ ~ ~ 2 0 2 0 150"
else if {netherite_sword::charge-level} is 4:
make console execute "/execute at %player% run particle lava ~ ~ ~ 3 0 3 0 200"
set {netherite_sword::charging} to false
if {netherite_sword::charging} is false:
set {netherite_sword::charge-level} to 0
set event-player's tool to player's slot 1
# Full charge attack
play sound "entity.blaze.shoot" at player
if entities are within 8 blocks around event-player:
apply slowness potion of tier 255 without particles to the entities for 2 seconds
apply weakness potion of tier 2 without particles to the entities for 5 seconds

on damage of player:
set {netherite_sword::charging} to false
cancel event

on sneak toggle:
if player is sneaking:
set {netherite_sword::charging} to false

on damage:
if attacker is holding netherite sword:
set {_p} to attacker
set {_OD} to {_p}'s damage
if {netherite_sword::charge-level} is 1:
increase {_p}'s damage by 4
if {netherite_sword::charge-level} is 2:
increase {_p}'s damage by 8
if {netherite_sword::charge-level} is 3:
increase {_p}'s damage by 12
if {netherite_sword::charge-level} is 4:
increase {_p}'s damage by 16
apply strength potion of tier 3 without particles to attacker for 10 seconds
wait 5 seconds
set {_p}'s damage to {_OD}

 
for faster communication, bc if you would respond like that after 1 day, it would take days to solve it, your code doesnt make much sense to me, so i cant help you in this stage.