#inventory save!

1 messages · Page 1 of 1 (latest)

sacred hinge
#
on player move:
  if player is in world "survival":
    add player's current inventory to {loopitemslist::*}
on teleport:
  if player is in world "hub":
    give {loopitemslist::*} to player
``` this skript doesnt work. i want this skript to save the players inventory example:
in hub ur inv is cleared and u get a server list compass
when you go  back to survival world you get the items you had last. it doesnt work. i even moved.
placid quiver
#

why use on player move?

#

also I think you need to specify what element you want to give to the player out of {loopsitemslist::*}

sacred hinge
#

What Could I Change To Give The Player The Item

#

You Cant Use Every 1 second

pseudo garden
#

Just save the inv on quit/world change

#

Id recommend storing the items as {inventory::%player’s uuid%::(slot number)}

sacred hinge
#

Wdym

#

idk how to use ()

#

could you show example

#

of storing items

#

because that didnt work

pseudo garden
#

Those are just there for you not the code

#

Thats just where u put the slot number

#

There are many examples/snippets on the internet, look at those.

sacred hinge
#

wait do i have to put the slot number there?? then that wouldnt work

#

like

#
{inventory::%player’s uuid%::(slot 5)}
pseudo garden
#

No….

sacred hinge
#
{inventory::%player’s uuid%::(slot number)}
#

do i do

#
add player's current inventory to {inventory::%player’s uuid%::(slot number)}
pseudo garden
#

N o

#

Please learn how to use lists

sacred hinge
#

b r u h

#

i do

#

i dont

pseudo garden
#

And just skript in general

sacred hinge
#

undersand

#

slot number

pseudo garden
#

The p a r e n t h e s i s are there for a reason

sacred hinge
#

slot number 5

#

??

#

can you just explain it what slot number is

sacred hinge
pseudo garden
#

You have to put the number there, not hope skript can figure it out

sacred hinge
#

for every single damn inventory slot

pseudo garden
#

Yes. Thats why you are LOOPING

sacred hinge
#

that gonna take 36 lines

#

so like

pseudo garden
#

No….

sacred hinge
#
add player's current inventory to {inventory::%player’s uuid%::(slot number 0)}
```?
pseudo garden
#

Plus armour slots and offhand its around 40 slots, but with a LOOP it will take less than 5 lines

sacred hinge
#

your my only hope

#

how will it take less lines?

pseudo garden
#

you’re*

#

Do you know what a loop is

sacred hinge
#

yeah

#

ex

#
loop all players
#
give player loop-value
#

@sacred hinge when you got a answer of help

#

nvm

#
command /showinv:
    trigger:
        restore inventory of player from {Stuff}
        set {_inv} to chest with 6 rows named "Stuff"
        set {_inv}'s serialized contents to {Stuff}
        open {_inv} to player
       
command /saveinv:
    set {Stuff} to player's serialized inventory
    send "&a&l[✓] &fSaved"
``` got this from internet is that still a good working skript?
#

@pseudo garden

#
command /showinv:
  trigger:
    set {inventory::%uuid of player%} to the player's serialized inventory
    wait 1 tick
    clear the player's inventory
command /giveinv:
  trigger:
    restore inventory of player from {inventory::%uuid of player%}
``` doesnt work
#

please help

#

got from google

pseudo garden
sacred hinge
#

Thanks I Will Test It Out

sacred hinge
#

worked

#

i will try with worlds now

#

what variable i use to save player's inventory

#

@pseudo garden

pseudo garden
#

Whatever you want to call it…..

sacred hinge
#
every 1 second in world "blisssmp":
  loop 41 times:
    set {save::%uuid of player%::slot::%loop-number%} to slot loop-number - 1 of player
  clear inventory of player
``` i got stuck with errors for line 4 and 3 periodical event
any other variables i could use?
sacred hinge
#

Please

devout goblet
#

looping 41 times every second is a great lag machine

#

not to mention you are planning on looping all players with that too

#

and the error you would be getting will tell you whats wrong

#

(syntaxically)

sacred hinge
#

can you just tell me another variable that wont give me errors and that will work

#

i will figure everything else out

#

i just need a variable that could work

#

with worlds inv clear all that

#

i tried to do

dusky shard
#

Why are you doing this every second

#

You should pick a better event

#

Like on world change

#

Or make it a function and call it when you teleport them

#

Or anything thats less laggy

pseudo garden
#

Ive tried helping you, but you just dont listen

pseudo garden
#

Dont come crying to others if you havent tried looking at it yourself

sacred hinge
sacred hinge
sacred hinge
#

DONE!

#

it works

#

🙂

#

time for a real test

#

thank you

#

you smart people

#

you have just saved my server

#

100% big brain people