minetest.deserialize

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

Description

Convert a string returned by minetest.serialize() into a table. String is loaded in an empty sandbox environment. Will load functions, but they cannot access the global environment.

Example 1

deserialize('return { ["foo"] = "bar" }'){foo='bar'}

Example 2

deserialize('print("foo")')nil (function call fails)

error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value)

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox