#why does it not give the player a item on respawn
1 messages · Page 1 of 1 (latest)
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
after respawn.
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
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%}```
idk what that is but the post is solved
by putting the uuid in there it makes sure each player can only access their own list
and this will take up storage, you can delete the list after you give the items
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```
idk
i gave you examples
yeah, ive been telling them...
the names are fine
you do realise that that means that
- it will be hard to remeber which list is for what
- 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
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
ok
am not changing the names
.
this is like the 3rd instance of you intentionally keeping your code messy and unreadable
I like the names
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
the names aren't that important
organisation is very important
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.
can I get another example?
a simpler one
no asterisk there, always goes at the end
asterisk is not a word
you can add another separator there too
..?
what is a separator?
a thing to separate objects
in this case ::
to separate indicies from eachother
what varaible
the one you already have
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?
yes
and still give them comprehensible names
literally this example
just a new section and put it in
the example is hard to understand
is it?
thats what you had earlier and I said no
do you want me to get the player uuid whne they die and then use that uuid to give it back to the player?
i went from {balance} to {balance::%player's uuid%}
yes, exactly!
.
oh ok
this is an example for a single object. you have a list, meaning you will have another secion with an asterisk at the end
again this is absic knowledge, and if you dont know you can always consult google
well, if you didnt only look at tutorials as a last resort, and then only the bare minimum, maybe you would have
oh
if you want to learn you need to use the resources available
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
you are asking if the same thing will work for the 3rd time
youre already doing it via the expression
%player%'s uuid
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}````
x8ight would this work also idk how to test it so I just have to ask you it has no errors tho
well...
youre being creative, ill give you that
but youre also overcomplicating this
oh
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.
.
oh
this doesn't help
I still have no idea what to do
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....
okay
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
maybe if you gave them better names it would
remove {list::*} from the drops```
accept what?
what am i supposed to be accepting? what are you giving me?
I think you mean "except"
this is the only part the the skript that makes sense
if you want to lean you cant just ignore the fundamentals
do you know what "fundamental" means?
yes
skript is a psuedocode (designed to be ridiculously intuitive for beginners), but that doesn't mean that anyone can learn it instantly.
be cause you're rushing in
you're running a marathon, you need to pace yourself, allow your breath to catch up, and drink some water.
what tutorial
any of the ones you were recommended
yes, i did
no
I thought you meant this post
tutorials are general, not niche.
especially beginner ones
just because youre doing something different doesnt make them useless
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.
no
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:
- https://sovdee.gitbook.io/skript-tutorials/
- YouTube (old): Minehut, Its Jackson, Fan Staaff
- google some and find your own
- be careful who's you use, they may not be perfect and you may develop/reinforce bad habits
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
.
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```
.
fine
okay im back
what did you find?
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```
nothing still clueless
you can specify the indicies and save a line too
ok
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
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```
but now you can easilt refer to the ones you want without the hassles of keeping track of a bunch on numbers
ok
one issue at a time, stop getting ahead of yourself
In your IDE, you could just do ctrl h to find & replace certain things
.
?
there is no wwater
…
its an analogy, im telling you you are rushing and its better to slow down and take your time
am not rushing'
well, youre at least moving on to more issues without fixing past ones
yeah, i explained that
ok
You can have@multiple separators in a list
so I create this list every time they die then give it back to them?
pretty much
.
instead of 1 for ALL players
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```
closer
at least in parser
you want the list with the uuid, not the list that everyone can access
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?
x8
if victim's inventory contains loop-value:
add 1 of loop-value to {idk::%player's uuid%::*}``` what do these lines even do
Is the on death event called before they die or right after?
https://tryitands.ee
but looks like it would work, just use a better name than idk
i beleive right before, as its cancelable, but good point, maybe loop before you edit the drops to be safe
well I have no idea what it is or what it does or why the list is even there so "idk" is a good name
weve been walking you through this for days
Yeah… that’s what I thought
you're keeping track of what they had and returning it, but afterwars those lists still take up storage
do just delete the list after you give them the stuff back
and change the name
and indicies
ok
then your code is perfect
you can use the ::* to refer to everything at once
so its not perfect
Barely anybody makes perfect code ever
well idk what your talking about so
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
is your code functional? yes
idk
but its still messy
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
^ if you always just do the bare minimum you wont improve as much, or at all
x8ight how do you get links to past posts
search for them, then right click and copy the link. works for messages too
ok
oh