#skript problem

1 messages · Page 1 of 1 (latest)

silver pendant
strong mauve
#

Thats using Skbee

#

also for the send message you need to put to player on the end.

silver pendant
#

but with to player

strong mauve
#

do you have skbee installed?

silver pendant
#

yes

strong mauve
#

In newer versions you need to specify the type of the tag as well

#

such as

string tag "test" of {_nbt}
int tag "test" of {_nbt}```
#

that should fix the send messages with to player on the end though.

silver pendant
#

wait

#

so like

#
            (metadata tag "dooruse" of player) < now
            send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
            set metadata tag "dooruse" of player to 1 second later
    else:
        (metadata tag "dooruse" of player) < now
        send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
        set metadata tag "dooruse" of player to 1 second later```
strong mauve
#

try it

silver pendant
#

oh yeah

#

the 40 error is gone now

keen burrow
#

delete skquery

silver pendant
#

why

strong mauve
#

skquery is fairly outdated but not likely the cause of these issues, not using it is probably better though as it can be replaced with Skbee.

silver pendant
#

yeah still same errors whitout skquery

keen burrow
#

you need to specify the tag types

strong mauve
#

Can you send the remaining errors?

keen burrow
#

intstead of tag "" of ..., use int/byte tag "" of ...

#

whoops that was mentioned

#

i just scrolled to the errors

keen burrow
silver pendant
strong mauve
#

You have still not put the tag types there.

silver pendant
strong mauve
#

still not put to player

#

and missing a type again

#

its the same 2 errors just repeated.

silver pendant
#

where to player

strong mauve
#

at the end...

#

its the exact same error

keen burrow
#

...

silver pendant
#

line 20

keen burrow
#

always specify who to send messages to

silver pendant
#

i don't really know witch tag to use

strong mauve
#

what is keycardlevel set to?

#

you probably want to use a double or an int

silver pendant
#

it should be an int

#

like /givekey 3

strong mauve
#

double works with decimals or without, int wont work with decimals

silver pendant
#

i don't need decimans

strong mauve
#

ok, then you can use an int

#
int tag "test" of {_nbt}```
silver pendant
#

hold on i crushed

keen burrow
silver pendant
#

in line 17 if i but int before tag the error disappears

#

so i should put into before all tags?

#

ok it works

#

but the skript doesn't work

#

no errors

keen burrow
keen burrow
silver pendant
#

i put in the code send "test" to player

#

nothing appears on my chat

#

i don't really know why it doesn't work

keen burrow
#

well, sicne I cant read minds, i cant help you if I cant see the code...

#

and if the debug message doesnt show up, a condition fails

silver pendant
#
  permission: op
  trigger:
    give player iron door named "&cLevel %arg% door" with nbt from "{keycardlevel:%arg%}"

function KeyCard(level:integer) :: item:
  return name tag named "&cLevel %{_level}% KeyCard" with nbt from "{keycardlevel:%{_level}%}"


command /givecard <integer>:
  permission: op
  trigger:
    give player KeyCard(arg)

on place of iron door:
  nbt of tool has tag "keycardlevel"
  set {_tier} to int tag "keycardlevel" of nbt of tool
  set int tag "keycardlevel" of nbt of event-block to {_tier}
  set int tag "keycardlevel" of nbt of (block above event-block) to {_tier}
  send "placed door level %{_tier}%" to player
  send "test" to player

on right click on iron door:
    nbt of event-block has tag "keycardlevel"
    if metadata tag "dooruse" of player is not set:
        set metadata tag "dooruse" of player to 10 seconds ago
    if nbt of tool has tag "keycardlevel":
        if int tag "keycardlevel" of nbt of tool >= int tag "keycardlevel" of nbt of event-block:
            if (block data tag "open" of event-block) = false:
                open clicked block
                play sound "BLOCK_IRON_DOOR_OPEN"
                wait 1 second
                close clicked block
                play sound "BLOCK_IRON_DOOR_CLOSE"
                send "test2" to player
        else:
            (metadata tag "dooruse" of player) < now
            send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
            set metadata tag "dooruse" of player to 1 second later
    else:
        (metadata tag "dooruse" of player) < now
        send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
        set metadata tag "dooruse" of player to 1 second later```
silver pendant
#

but i don't know what are the right tags to put

keen burrow
#

debug after each condition and see which one it stops at

silver pendant
# keen burrow debug after each condition and see which one it stops at
  permission: op
  trigger:
    give player iron door named "&cLevel %arg% door" with nbt from "{keycardlevel:%arg%}"

function KeyCard(level:integer) :: item:
  return name tag named "&cLevel %{_level}% KeyCard" with nbt from "{keycardlevel:%{_level}%}"


command /givecard <integer>:
  permission: op
  trigger:
    give player KeyCard(arg)

on place of iron door:
  nbt of tool has tag "keycardlevel"
  set {_tier} to int tag "keycardlevel" of nbt of tool
  set int tag "keycardlevel" of nbt of event-block to {_tier}
  set int tag "keycardlevel" of nbt of (block above event-block) to {_tier}
  send "placed door level %{_tier}%" to player
  send "door1" to player

on right click on iron door:
    nbt of event-block has tag "keycardlevel"
    if metadata tag "dooruse" of player is not set:
        send "key1" to player
        set metadata tag "dooruse" of player to 10 seconds ago
    if nbt of tool has tag "keycardlevel":
        send "key2" to player
        if int tag "keycardlevel" of nbt of tool >= int tag "keycardlevel" of nbt of event-block:
            send "key3" to player
            if (block data tag "open" of event-block) = false:
                send "key4" to player
                open clicked block
                play sound "BLOCK_IRON_DOOR_OPEN"
                wait 1 second
                close clicked block
                play sound "BLOCK_IRON_DOOR_CLOSE"
                send "test2" to player
        else:
            (metadata tag "dooruse" of player) < now
            send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
            set metadata tag "dooruse" of player to 1 second later
    else:
        (metadata tag "dooruse" of player) < now
        send "&7You need &aKeyCard level %string tag "keycardlevel" of nbt of event-block% or higher &7to open this door!" to player
        set metadata tag "dooruse" of player to 1 second later```
#

when i place the door i get this message

keen burrow
#

try nbt of tool -> NBT compound of player's tool

#

might also wanna stick some parenthesis in there

silver pendant
#

doors still dont work + no messages

keen burrow
#

if theres no messages conditions fail

silver pendant
#

whats wrong with it

keen burrow
#

debug and you might find out

silver pendant
manic portal
keen burrow
silver pendant
#

is this cool

silver pendant
keen burrow
#

then the condition here

#

fails

silver pendant
#

why

keen burrow
#

i guess the nbt compound of the tool doesnt have that tag then

silver pendant
#

why

keen burrow
#

you tell me

#

are you sure you added it correctly?

#

broadcast the nbt compound of your item

silver pendant
#

i get the message

keen burrow
#

thats not what I asked you to do

silver pendant
silver pendant
keen burrow
#

thats pretty much the line

silver pendant
keen burrow
#

broadcast ...

silver pendant
keen burrow
#

just literally put it after the word broadcast

silver pendant
keen burrow
#

no

#

and there's no need to ping me each message

silver pendant
#

then how

#

bro what is this i've never heard of broadcasting the "nbt compounds" of an item

keen burrow
#

you're literally working with nbt

#

you literally use it in your code

silver pendant
#

still nothing on my chat

keen burrow
#

you're broadcasting it after the condition you know to fail

#

just do it in an effect command or in another right click event

silver pendant
#

i get {} if i get the item, place it or right click it

keen burrow
#

so then its got empty NBT

#

probably because youre using {keycardlevel:42} instead of like {keycardlevel:42b}, which would make it a byte tag.

#

I would just set {_item} to 1 of iron door ... set int tag "..." of NBT compound of {_item} to arg-1 give player {_item}

silver pendant
#

but there is still a problem

#

oh yeah and the keycard still have {} as value

keen burrow
#

because youre trying to get a string tag

#

which was never set

#

you set an int tag

silver pendant
#

ok now the message is right

#

but keys still don't open doors

#

with the value {} on right click

keen burrow
#

can you send the updated code

silver pendant
keen burrow
#

is the broadcast "skript" run?

silver pendant
#

witch one

#

on right click only 2

#

on door place 5

keen burrow
#

okay, maybe dont have each message be the same thing then

silver pendant
#

like this then

#

yeah on right click i only get to skript key 1

keen burrow
#

so then NBT compound of player's tool has tag "keycardlevel" fails

silver pendant
#

why

keen burrow
#

i guess it doesnt have the tag

silver pendant
#

mh

#

should i do the same nbt thing with keycards

keen burrow
#

sure

silver pendant
#

like this?

#
  set {_key} to 1 of name tag
  set int tag "keycardlevel" of NBT compound of {_key} to arg-1
  return {_key} named "&cLevel %{_level}% KeyCard"```
#

no it doesnt work

#

wait no

#

what am i doing

#

bro idk what to do