#Help me identify errors

1 messages · Page 1 of 1 (latest)

silent flame
#

Here is the code it’s complex ```command /giveWand [<player>]:
trigger:
if arg-1 is not set:
give player a stick named "&6Wand of Teleportation"
send "&aYou received the &6Wand of Teleportation&a!"
else:
give arg-1 a stick named "&6Wand of Teleportation"
send "&aYou gave &6Wand of Teleportation &ato %arg-1%."

on right click with stick:
if name of player's tool is "&6Wand of Teleportation":
if {wandCooldown::%uuid of player%} is set:
send "&cYou must wait before using the Wand of Teleportation again!"
else:
set {wandCooldown::%uuid of player%} to now
teleport player to location (random integer between -100 and 100) blocks east, (random integer between 1 and 256) blocks up, (random integer between -100 and 100) blocks south from location of player
send "&aYou have been teleported to a random location!"
wait 60 seconds real time
delete {wandCooldown::%uuid of player%}

#

@cloud drift

cloud drift
#

?

#

oh yo

silent flame
#

Yo

#

I need help with my custom item

cloud drift
#

What's the problem?

#

Is it a logic error?

silent flame
#

Yes

#

Nooo

cloud drift
#

k

silent flame
#

I used

#

In

#

Parser

cloud drift
#

Ok, so it's a real error

silent flame
#

It has none logic drrors

cloud drift
#

send me what it says

silent flame
#

Yes

#

I didn’t try it yet

#

But

#

I will

cloud drift
#

send

silent flame
#

Then I will send lol

#

I didn’t try

#

Yet

#

Sad

#

Can you spot any erorrs rn tho

drifting vine
#

what error did it give in parser

silent flame
#

Indent lol

#

No others

drifting vine
#

bruh

cloud drift
#

Ah let's see

drifting vine
cloud drift
#

No, it gave real errors

silent flame
#

bc my minehut server expired max time

cloud drift
#

Let's see

silent flame
#

Wdym

cloud drift
#

Use the location function first of all

#

And use local variables for the random teleport function

#

so

silent flame
#

Kk

cloud drift
#

location(player's x + whatever, player's y + whatever, player's z + whatever, whatever world, player's yaw, player's pitch)

silent flame
#

Friend helped me with that

cloud drift
#

Also, 60 seconds is always real time

silent flame
#

Confusing add

silent flame
cloud drift
#

It gives an error when you put real time

#

So just leave that be, just put wait 60 seconds

silent flame
#

Ohh

#

Ye

#

What else can you see

cloud drift
#

So you could do

silent flame
#

Ty

cloud drift
#

Also, you shouldn't put a random Y value, so what you can do is

#

I believe there's a highest block at expression

silent flame
#

Kk tysm

#

Id that it or more error?

cloud drift
#

I think that's it

#

unless there's any logic

silent flame
#

There isn’t

cloud drift
#

That's it for parser errors though

silent flame
#

Oh

#

What about

#

Syntax

#

lol

#

@cloud drift

cloud drift
#

?

#

syntax is good

silent flame
#

Oh ok

cloud drift
#

At least, if you fix the random teleport line

silent flame
#

What was most of my errors on

cloud drift
#

you had 2

#

largest one was the teleport line

silent flame
#

2 isn’t that much

#

Alr ty rrl6 lemme fox and send

cloud drift
#

k

silent flame
#

@cloud drift

cloud drift
#

?

#

No need to ping

silent flame
#
    trigger:
        if arg-1 is not set:
            give player a stick named "&6Wand of Teleportation"
            send "&aYou received the &6Wand of Teleportation&a!"
        else:
            give arg-1 a stick named "&6Wand of Teleportation"
            send "&aYou gave &6Wand of Teleportation &ato %arg-1%."

on right click with stick:
    if name of player's tool is "&6Wand of Teleportation":
        if {wandCooldown::%uuid of player%} is set:
            send "&cYou must wait before using the Wand of Teleportation again!"
        else:
            set {wandCooldown::%uuid of player%} to now
            set {_x} to random integer between -100 and 100
            set {_z} to random integer between -100 and 100
            set {_loc} to location {_x} blocks east, 0 blocks up, {_z} blocks south from location of player
            set {_y} to y-coordinate of highest block at {_loc}
            teleport player to {_loc} with y-coordinate set to {_y}
            send "&aYou have been teleported to a random location!"
            wait 60 seconds
            delete {wandCooldown::%uuid of player%}
#

Ok sorry

cloud drift
#

let's see so

#

Just use the location function

silent flame
#

It will work anyway I think

cloud drift
#

No, it isn't going to work

silent flame
#

Oh

drifting vine
#

i hate when people use tab or 4 space

cloud drift
#

why?

silent flame
#

?

drifting vine
cloud drift
#

Makes it difficult to read?

#

Yeah I get that

#

Oh wait nvm

#

that's tuske