Skip to content

Restoring inventory from variable #35

Description

@fredagsguf

Description

set {staffinv::%uuid of player%::inventory} to the player's serialized inventory works just fine, but when you restore the inventory using restore inventory of player from {staffinv::%uuid of player%::inventory} it doesn't do anything and prints out the error below.

Steps to Reproduce

command /sm:
	trigger:
		if {staffmode::%uuid of player%} is not set:
			set {staffmode::%uuid of player%} to true
			set {staffinv::%uuid of player%::inventory} to the player's serialized inventory
			wait 1 tick
			clear player's inventory
			message "Turned on"
		else:
			delete {staffmode::%uuid of player%}
			message "Turned off"
			restore inventory of player from {staffinv::%uuid of player%::inventory}

Expected Behavior

I expected it to actually restore the inventory.

Errors / Screenshots

https://paste.gg/p/anonymous/eafb559482d540ffb6990b4e633b6a89

Server Information

Server version/platform: Paper-143
Skript version: Skript 2.4.1
SkQuery version: SkQuery 3.6.5


Activity

  1. DevilishDante commented on May 12, 2021

    @DevilishDante

    hi , you can use
    set {staffinv::%uuid of player%::inventory} to serialized contents of player's current inventory #for saving

    and
    set serialized contents of player's current inventory to {staffinv::%uuid of player%::inventory} # for restore

    tell me if that worked ;)

  2. mybe commented on Jul 23, 2023

    @mybe

    This is not working in SkQuery 4.1.9

  3. VRXDev2 commented on Aug 7, 2023

    @VRXDev2

    Same issue as mybe, nothing happens once it's triggered.

  4. woodchest commented on Jun 24, 2024

    @woodchest

    any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions