#why does it not give the player a item on respawn

1 messages · Page 1 of 1 (latest)

knotty junco
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {_test::*}
on respawn:
    event-entity is player
    give {_test::*} to player``` it removes the drops but the player does not get the item on respawn
#

it used to work

spice pivot
#

event-entity is player
this is useless, only players can respawn

again, thats a local variable and cannot be brought across events.
also, i really recommend better names.
you also need to make them player-specific, add the uuid in there

you may also need to waitatick after respawn.

knotty junco
#

oh

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
on respawn:
    wait 1 tick
    give {test::*} to player```
#

I made it global

#

IT WORKS

#

I TESTED IT

#

ty

#

post is solved

spice pivot
#

now you need to make it player specific```set {balance} to 1000
on buy: # (made up event for this example)
remove price from {balance}

Here, this variable is for ALL players. Meaning, in a sense, all players have the same wallet.

on buy:
remove price from {balance::%player's uuid%}```

knotty junco
#

idk what that is but the post is solved

spice pivot
spice pivot
#

and this will take up storage, you can delete the list after you give the items

knotty junco
#

ok

#

so how do I put the uuid in my skript

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
on respawn:
    wait 1 tick
    give {test::*} to player```
wild dock
#

Why

#

Are you using {test}

#

And {list}

knotty junco
#

idk

spice pivot
spice pivot
knotty junco
#

the names are fine

spice pivot
# knotty junco idk

you do realise that that means that

  1. it will be hard to remeber which list is for what
  2. if you name another lists (which you will at some point in the future), and you again, are unspecific with the name, like 2 lists, they will interfere with eachother
spice pivot
# knotty junco the names are fine

for a throwaway local var, if you want to have a funny name as a joke, go for it. but for a global var that you will be using, no. it is not fine

knotty junco
#

ok

knotty junco
#

am not changing the names

spice pivot
#

why not

#

it takes 20 seconds, and

spice pivot
#

this is like the 3rd instance of you intentionally keeping your code messy and unreadable

knotty junco
#

I like the names

spice pivot
#

they are very unintuitive

#

if you want to make things difficult for yourself, we cant stop you, but if you are going to ask others to look at your code it should be legible

knotty junco
#

the names aren't that important

spice pivot
#

organisation is very important

wild dock
#

If you ever want to code for somebody

#

As a job

#

Or such

#

I’ve been told, ”You don’t code just for the computer, it’s for other people, too”. Other people may need your examples and your help in the future and if you aren’t clear with what things do, it isn’t easy for anybody.

knotty junco
#

a simpler one

spice pivot
#

thats literally as simple as i can make it

#

just add the uuid into the variable

knotty junco
#

oh

#

{test::*%player's uuid%}

#

that is all i could get out of it

spice pivot
#

no asterisk there, always goes at the end

knotty junco
#

asterisk is not a word

spice pivot
#

you can add another separator there too

spice pivot
knotty junco
#

what is a separator?

spice pivot
#

in this case ::

#

to separate indicies from eachother

knotty junco
#

oh

#

ok

knotty junco
spice pivot
#

the one you already have

knotty junco
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::*%player's uuid%}
on respawn:
    wait 1 tick
    give {test::*} to player```
#

the test variable?

spice pivot
#

yes

knotty junco
#

ok

#

so how do I add it to the variable

spice pivot
#

and still give them comprehensible names

spice pivot
#

just a new section and put it in

knotty junco
#

the example is hard to understand

spice pivot
#

is it?

knotty junco
#

{test::*%player's uuid%}

#

like this?

spice pivot
#

thats what you had earlier and I said no

knotty junco
#

do you want me to get the player uuid whne they die and then use that uuid to give it back to the player?

spice pivot
#

i went from {balance} to {balance::%player's uuid%}

knotty junco
#

oh ok

spice pivot
knotty junco
#

thats why it was hard to understand

#

wtf is a "asterisk"

#

is that even a word?

spice pivot
spice pivot
knotty junco
#

that is not basic knowledge

#

I have never heard that word before

spice pivot
#

well, if you didnt only look at tutorials as a last resort, and then only the bare minimum, maybe you would have

knotty junco
#

oh

spice pivot
#

if you want to learn you need to use the resources available

knotty junco
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::*%player's uuid%}```
#

so how do we get the uuid of the player

spice pivot
spice pivot
knotty junco
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            get the %player%'s uuid```
#

would this work?

#

nvm

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            set {e} to player's uuid
on respawn:
    wait 1 tick
    give {test::*} to player```
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            set {e} to player's uuid
on respawn:
    wait 1 tick
    give {test::*} to {e}````
knotty junco
spice pivot
#

well...

#

youre being creative, ill give you that

#

but youre also overcomplicating this

knotty junco
#

oh

spice pivot
#

you dont need to set {e} to a player's uuid

  • this re-introduces the issue of multiple players accessing this at once and screwing things up
  • just use the expression, someone's uuid
#

and you arent giving it to the uuid, but to the player

#

the uuid is, well, an ID.

knotty junco
#

oh

knotty junco
#

idk how to do this

spice pivot
#

{gens::%player's uuid%::*}

#

dont. give. up.

knotty junco
spice pivot
#

that

#

doesn't

#

help

knotty junco
#

I still have no idea what to do

spice pivot
#

i'm not gonna say that that's copy-pasteable, cause then you'll just do that and only care that you have minimally functional code, but....

knotty junco
#

bruh what

#

I can't do this

spice pivot
#

okay

knotty junco
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {gens::%player's uuid%::*}```
#

nothing of this skript makes any sense

spice pivot
knotty junco
#
    remove {list::*} from the drops```
spice pivot
#

accept what?

#

what am i supposed to be accepting? what are you giving me?

#

I think you mean "except"

knotty junco
spice pivot
knotty junco
#

??????????

#

what fundamentals?

spice pivot
#

do you know what "fundamental" means?

knotty junco
#

yes

spice pivot
#

skript is a psuedocode (designed to be ridiculously intuitive for beginners), but that doesn't mean that anyone can learn it instantly.

knotty junco
#

iik

#

but I don't get this at all

#

and nothing is helping

spice pivot
#

you're running a marathon, you need to pace yourself, allow your breath to catch up, and drink some water.

knotty junco
#

what tutorial

spice pivot
#

any of the ones you were recommended

knotty junco
#

what ones that I was recommened

#

you never recommended me any tutorials

spice pivot
#

yes, i did

knotty junco
#

no

spice pivot
#

heres two instances, ill stop there

knotty junco
#

I thought you meant this post

spice pivot
#

tutorials are general, not niche.

#

especially beginner ones

#

just because youre doing something different doesnt make them useless

knotty junco
#

ok

#

I give up

spice pivot
#

can I be honest here?

#

you hold all the power here.

#

i cannot control your mind

#

if you give up, then its over.

#

i cant do any more.

knotty junco
#

pk

#

ok

knotty junco
spice pivot
#

here's what I'm going to do:
i'm going to go and do a load of laundry and take a shower.

while i do that, i would like you to look at some tutorials and see if you can make any progress before I get back.
Here's a good starting point:

knotty junco
#

ok

#

{test::%player's uuid%::*} would this work?

#

I have no clue

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {test::*} to player```
#

honestly

#

idk

#

ask x8ight

knotty junco
#

this I guess

#

not really

#

the post was already solved

#

but x8ight wants me to do this

#

for like something

#

I guess its a improvement to the skript

#

am so clueless

#

yes

#

like keep inventory

#

oh

#

so how do I fix those issues

#

oh

#

well I don't know how to do that

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {test::*} to player```
#

oh

#

heres the whole skript

#
    set {red} to red wool named "Flame Wool" with lore "this is flame wool" and "idk"
    set {blue} to light blue wool named "Water Wool" with lore "this is water wool" and "idk"
    set {white} to white wool named "Feather Wool" with lore "light as a feather" and "like a chicken"
    set {purple} to purple wool named "Space Wool" with lore "came from space?" and "maybe?"
    set {lime} to lime wool named "Earth Wool" with lore "its made out of rock" and "wait but its wool"
    set {list::*} to {red}, {blue}, {white}, {purple} and {lime}
    give player random element of {list::*}
on place:
    if event-item is {red} or {blue} or {white} or {purple} or {lime}:
        cancel event
on drop:
    if event-item is {red} or {blue} or {white} or {purple} or {lime}:
        cancel event
on death of player:
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {test::*} to player```
#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {test::*} to player```like this?
#

oh

#
    remove {list::*} from the drops
    loop {list::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {test::*}
            {test::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {test::%player's uuid%::*} to player```
wild dock
#

Please

#

For the love of god

#

Use comprehensible names

knotty junco
#

fine

spice pivot
#

okay im back

knotty junco
#
    set {red} to red wool named "Flame Wool" with lore "this is flame wool" and "idk"
    set {blue} to light blue wool named "Water Wool" with lore "this is water wool" and "idk"
    set {white} to white wool named "Feather Wool" with lore "light as a feather" and "like a chicken"
    set {purple} to purple wool named "Space Wool" with lore "came from space?" and "maybe?"
    set {lime} to lime wool named "Earth Wool" with lore "its made out of rock" and "wait but its wool"
    set {Wools::*} to {red}, {blue}, {white}, {purple} and {lime}
    give player random element of {Wools::*}
on place:
    if event-item is {red} or {blue} or {white} or {purple} or {lime}:
        cancel event
on drop:
    if event-item is {red} or {blue} or {white} or {purple} or {lime}:
        cancel event
on death of player:
    remove {Wools::*} from the drops
    loop {Wools::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::*}
            {idk::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {idk::%player's uuid%::*} to player```
knotty junco
spice pivot
knotty junco
#

ok

spice pivot
#

set {wool::red/fire/whatever you want to name it} to red wool named "&cFire Magic Thing" with lore "&rThis grants you the ability to" and "&rdo (something)"

#

then, you have the same list, {wool::*}

#

yeah, its one from a week ago

knotty junco
#

yeah

#
    remove {Wools::*} from the drops
    loop {Wools::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::*}
            {idk::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {idk::%player's uuid%::*} to player```
spice pivot
knotty junco
#

ok

spice pivot
#

one issue at a time, stop getting ahead of yourself

wild dock
#

In your IDE, you could just do ctrl h to find & replace certain things

knotty junco
#

?

knotty junco
wild dock
#

spice pivot
knotty junco
#

yes

#

maybe

#

oh

spice pivot
knotty junco
#

am not rushing'

spice pivot
#

well, youre at least moving on to more issues without fixing past ones

#

yeah, i explained that

knotty junco
#

ok

wild dock
#

You can have@multiple separators in a list

spice pivot
knotty junco
#

oh

#

oh

spice pivot
#

wait no wrong link hold on

knotty junco
#

so I create this list every time they die then give it back to them?

spice pivot
#

pretty much

knotty junco
#

ih

#

oh

spice pivot
#

instead of 1 for ALL players

knotty junco
#

wouldn't this work then

#
    remove {Wools::*} from the drops
    loop {Wools::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::*}
            {idk::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {idk::%player's uuid%::*} to player```
spice pivot
#

closer

knotty junco
#

none of this makes sense

#

no error

spice pivot
knotty junco
#

at least in parser

spice pivot
#

you want the list with the uuid, not the list that everyone can access

knotty junco
#

oh

#

ok

#
    remove {Wools::*} from the drops
    loop {Wools::*}:
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::%player's uuid%::*}
on respawn:
    wait 1 tick
    give {idk::%player's uuid%::*} to player```so like this?
wild dock
#

x8

knotty junco
#
        if victim's inventory contains loop-value:
            add 1 of loop-value to {idk::%player's uuid%::*}``` what do these lines even do
wild dock
#

Is the on death event called before they die or right after?

spice pivot
spice pivot
knotty junco
spice pivot
wild dock
spice pivot
knotty junco
#

ok

#

so is this post solved?

spice pivot
#

do just delete the list after you give them the stuff back

#

and change the name

#

and indicies

knotty junco
#

ok

spice pivot
#

then your code is perfect

knotty junco
#

well

#

am not actually doing any of that

spice pivot
knotty junco
#

so its not perfect

spice pivot
#

not if you give up

#

and dont try

wild dock
knotty junco
#

well idk what your talking about so

spice pivot
#

ofc if you leave it as minimally functional it wont be improved.

#

for it to improve, you have to improve it

#

the code doesnt evolve on its own

#

that might work yeah

knotty junco
#

is this post solved

#

am not looking to improve it

spice pivot
#

is your code functional? yes

knotty junco
#

idk

spice pivot
#

but its still messy

knotty junco
#

am satified

#

satisfied

wild dock
#

Yo

#

I wanna just say

#

If you don’t want to improve your code, you can’t really learn some of the most important key concepts

#

Your code is functional but it may be possible to improve and learn new concepts

spice pivot
#

^ if you always just do the bare minimum you wont improve as much, or at all

knotty junco
#

x8ight how do you get links to past posts

spice pivot
#

search for them, then right click and copy the link. works for messages too

knotty junco
#

ok

spice pivot
#

#1190158257952653374 message

knotty junco
#

oh

#

how do you send a video like that

spice pivot
#

i used my phone

#

too lazy to open up screen recording software

knotty junco
#

oh