#need help with small project

1 messages · Page 1 of 1 (latest)

upbeat oxide
#
    permission: op
    trigger:
        give player fishing rod named "§4Fishing Rod"

on fishing line cast:
    if name of player's tool is "§4Fishing Rod":
        if {custom.%player%} is true:
            send "blabla" to player
            stop
        set {custom.%player%} to true

        # Shapes (requires skBee)
        set {_shape1} to circle with radius 1
        set {_shape2} to circle with radius 2
        set {_shape3} to circle with radius 3

        set particle {_shape1} to dustOption(red, 1.5)
        set particle {_shape2} to dustOption(red, 1.5)
        set particle {_shape3} to dustOption(red, 1.5)

        loop all living entities in radius 3 around player:
            if loop-entity is not player:
                push loop-entity backwards at speed 1
                push loop-entity upward at speed 0.5
                damage loop-entity by 4
                spawn 40 lava particles at loop-entity

        loop 15 times:
            make shape {_shape1} at player
            make shape {_shape2} at player
            make shape {_shape3} at player
            wait 5 ticks

        # Cooldown reset (2 seconds)
        wait 40 ticks
        delete {custom.%player%}

skript skbee skript-particle 1.21.8

no errors but when i cast the rod nothing happens

skript skbee skript-particle 1.21.8

no errors but when i cast the rod nothing happens'
simple wedge
#

did you debug

left fulcrumBOT
#

It is recommended that you don't use AI agents for multiple reasons @upbeat oxide:


2) Blindly trusting code from any source is a bad idea, especially on production servers. Even if the code that was generated appears to work, you have no clue what vulnerabilities it introduces or fails to protect against.

3) Using AI to write your code takes away from your learning and doesn't challenge you to develop problem solving skills.```
While AI can be used as a tool, it is necessary to understand what it is doing and check any code it creates. Since this is a learning community, we want to support your personal growth. As a result, we don't allow generated content in our help channels ([Rule 8](<#welcome-to-skunity message>))
wary sky
#

"# Shapes require skbee"

#

it's skript-particle

#

goddamn ai is devolving

upbeat oxide
#

i did it myself but i gave to ai to debug

#

cuz i legit have no idea whats going on

#

i was screen sharing to a friend while coding

#

he saw

upbeat oxide
left fulcrumBOT
#

Resonant suggests that you read this embed

Debug
What is debugging?

Debugging is the process of finding and fixing bugs/issues/errors within your code. For a more detailed explanation on proper debugging check out sovdee's page

Variables

Since you don't see the value of variables it can be easy to assume that everything is working properly even though that might not be the case. Variables and arguments in functions and commands might change throughout your code in unexpected ways. It is a good idea to broadcast your variables at different points in your code to confirm that the value is what you expect it to be.

on chat:
    broadcast {chats::%player's uuid%}
    add 1 to {chats::%player's uuid%}
    broadcast {chats::%player's uuid%}```
In this example we broadcast the variable to check its value before and after we add to it to make sure the value goes up. If the variable was set to a string (`set {chats::%player's uuid%} to "3"`) then we would be able to see that the value did not go up, alerting us of the issue.
Conditions

If your code does no seem to be doing anything it is a good idea to establish which parts of your code are being executed, especially when using conditions. To accomplish this, add a broadcast after each part of line of your code with a descriptive message.

on right click:
    broadcast "player clicked"
    if player's tool = iron sword:
        broadcast "player's tool was iron sword"
        set player's tool to diamond sword```
In this example, we would only see the `player clicked` message if the player was holding an apple, alerting us that the code stopped after the first condition.
NBT

If you are debugging nbt you can use send pretty nbt of nbt of player's tool with split to make it more readable.

upbeat oxide
#

i got stuck at if name of player's tool is "§4Fishing Rod"

#

because if i add broacast anything it says that i need 1tab instead of 2?

simple wedge
#

then the name isnt right

upbeat oxide
#

permission: op
trigger:
give player fishing rod named "§4Fishing Rod"

on leftclick holding a fishing rod:
if name of player's tool is "§4Fishing Rod"
broadcast {chats::%player's uuid%}
if {custom.%player%} is true:
send "blabla" to player
stop
set {custom.%player%} to true

#

it is tho

upbeat oxide
simple wedge
#

use & instead of §

upbeat oxide
#

does if name of player's tool even worl

#

is that correct for 1.21.8?

simple wedge
#

yes it is

simple wedge
upbeat oxide
simple wedge
#

no

#

the condition

upbeat oxide
#

oh

simple wedge
#

if name of player's tool is "x" there needs to be a :

upbeat oxide
#

i did

#

oh wait'

simple wedge
#

not sure why that wasnt returning an error

upbeat oxide
#

tysm

simple wedge
#

can you /reputation increase me pls :3

stable gardenBOT
#

You successfully increased @simple wedge's reputation. They now have 4 skoints

upbeat oxide
#

still doesnt worked

#

debugged

simple wedge
#

hm

upbeat oxide
#

this time its the "on leftclick"

#

command /custom:
permission: op
trigger:
give player fishing rod named "&4Fishing Rod"

on leftclick holding a fishing rod:
if name of player's tool is "&4Fishing Rod":
if {custom.%player%} is true:
send "blabla" to player
stop
set {custom.%player%} to true

    set {_shape1} to circle with radius 1
    set {_shape2} to circle with radius 2
    set {_shape3} to circle with radius 3

    set particle {_shape1} to dustOption(red, 1.5)
    set particle {_shape2} to dustOption(red, 1.5)
    set particle {_shape3} to dustOption(red, 1.5)

    loop all living entities in radius 3 around player:
        if loop-entity is not player:
            push loop-entity backwards at speed 1
            push loop-entity upward at speed 0.5
            damage loop-entity by 4
            spawn 40 lava particles at loop-entity

    loop 15 times:
        make shape {_shape1} at player
        make shape {_shape2} at player
        make shape {_shape3} at player
        wait 5 ticks

    delete {custom.%player%}
simple wedge
#

try on left click with a fishing rod:

#

also are you sure it should be on left click and not on right click? because your trying to do it when you throw the line right?

upbeat oxide
#

i mean

#

i js switched to leftclick to test

simple wedge
#

try on right click with a fishing rod:

upbeat oxide
#

on skript hub is also says
on fishing line cast:

simple wedge
#

thats called when a fishing event triggers

upbeat oxide
#

not working

simple wedge
#

you have a broadcast and it broadcasts nothing?

upbeat oxide
#

yeah

#

on right click with a fishing rod:
broadcast "adasd"

#

idk

simple wedge
#

can u send ur sk info

upbeat oxide
#

it used to work on 1.21.4

simple wedge
#

hm

#
    broadcast "hi"``` it works fine for me so thats odd
upbeat oxide
#

ill try making the file on visual

#

studio

#

cuz rn im using the server host panel

simple wedge
#

idk if that should change anything

upbeat oxide
#

it works

#

ill try smth else

#

ok

simple wedge
#

okay

upbeat oxide
#

js on right click with a fishing rod:
broadcast "hi"

#

works

#

but

#

on right click with a fishing rod:
if name of player's tool is "&4Fishing Rod":
broadcast "hello"

#

doesnt

simple wedge
#

broadcast name of player's tool

#

wait

#

no

#

broadcast debug info of name of player's tool

#

show me what it broadcasts

upbeat oxide
#

on right click with a fishing rod:
if name of player's tool is "&4Fishing Rod":
broadcast debug info of name of player's tool

#

?

simple wedge
#

no before the condition

upbeat oxide
#

ok

simple wedge
#

but also have a broadcast after the condition that broadcasts something else

upbeat oxide
simple wedge
#

it broadcasts nothing?

upbeat oxide
#

yeah

#

i think this is js a plugin problem

#

is it okay to instal from mondrinth?

simple wedge
#
on right click:
    broadcast "%debug info of name of player's tool%"
    if name of player's tool is "&4Fishing Rod":
        broadcast "worked"
``` try this and tell me what it broadcasts
simple wedge
simple wedge
#

it doesnt matter

upbeat oxide
#

yeah it works

simple wedge
#

then just use that

upbeat oxide
#

i add this and js doesnt work anymore

#

command /custom:
permission: op
trigger:
give player fishing rod named "&4Fishing Rod"

on right click:
broadcast "%debug info of name of player's tool%"
if name of player's tool is "&4Fishing Rod":
broadcast "worked"
if {custom.%player%} is true:
stop
set {custom.%player%} to true
broadcast "yea"

    set {_shape1} to circle with radius 1
    set {_shape2} to circle with radius 2
    set {_shape3} to circle with radius 3

    set particle {_shape1} to dustOption(red, 1.5)
    set particle {_shape2} to dustOption(red, 1.5)
    set particle {_shape3} to dustOption(red, 1.5)

    loop all living entities in radius 3 around player:
        if loop-entity is not player:
            push loop-entity backwards at speed 1
            push loop-entity upward at speed 0.5
            damage loop-entity by 4
            spawn 40 lava particles at loop-entity

    loop 15 times:
        make shape {_shape1} at player
        make shape {_shape2} at player
        make shape {_shape3} at player
        wait 5 ticks

    wait 40 ticks
    delete {custom.%player%}
simple wedge
#

idk then

#

seems like a bug

upbeat oxide
#

ill reinstall later

#

tysm tho

simple wedge
upbeat oxide
#

its fine

#

you tried your best and its not even your fault