-
-
Save GreenXenith/0ba0edfe1f1686f06a877905bab712db to your computer and use it in GitHub Desktop.
Entity staticdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on_activate = function(self, staticdata) | |
if staticdata ~= "" and staticdata ~= nil then | |
local data = minetest.deserialize(staticdata) | |
if data ~= nil then | |
self.props = data.props | |
self.attach = data.attach | |
self.object:set_attach(self.attach) | |
self.object:set_properties(self.props) | |
self.object:set_armor_groups({immortal = 1}) | |
end | |
end | |
end, | |
get_staticdata = function(self) | |
local data = { | |
props = self.object:get_properties(), | |
attach = self.object:get_attach(), | |
} | |
return minetest.serialize(data) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment