Below is a template for a ScriptableObjectClass script, used for executing background scripts that are not attached to a physical game object.
ScriptableObject = class()
-- Constants-- https://scrapmechanictools.com/lua/Game-Script-Environment/Constants#scriptableobjectolass
ScriptableObject.isSaveObject = false
-- Serverside Callbacks
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#oncreatefunction ScriptableObject.server_onCreate( self )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onrefreshfunction ScriptableObject.server_onRefresh( self )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onfixedupdatefunction ScriptableObject.server_onFixedUpdate( self, dt )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#ondestroyfunction ScriptableObject.server_onDestroy( self )
end
-- Clientside Callbacks
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#oncreatefunction ScriptableObject.client_onCreate( self )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onrefreshfunction ScriptableObject.client_onRefresh( self )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onfixedupdatefunction ScriptableObject.client_onFixedUpdate( self, dt )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onupdatefunction ScriptableObject.client_onUpdate( self, dt )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#onclientdataupdatefunction ScriptableObject.client_onClientDataUpdate( self, data, channel )
end
-- https://scrapmechanictools.com/lua/Game-Script-Environment/Classes/CommonCallbacks#ondestroyfunction ScriptableObject.client_onDestroy( self )
end