Jump to content

Recommended Posts

Component persistent data functions are as follows:

function ComponentName:OnSave()
	--Return a table containing data that you want to be persistent
	--For example:
	local data = {}
	data.someinfo = self.someinfo
	return data
end

function ComponentName:OnLoad(data)
	--The 'data' parameter is the table that you returned from 'OnSave'
	--Load your data back here
	--For example:
	if data.someinfo then
		self.someinfo = data.someinfo
	end
end

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...