A Question About Saved Lua Variables

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

A Question About Saved Lua Variables

#1

Post by KINGTUT10101 »

If I save a variable within "function script:update ()" using the following, is that variable not accessable from other functions, like "function script.nextDay ()" for example?

Code: Select all

local name = Util.optStorage(City.getStorage(), script:getDraft():getId())
User avatar
JustAnyone
Developer
Reactions:
Posts: 3479
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: A Question About Saved Lua Variables

#2

Post by JustAnyone »

You need to define global variables for that
Post Reply Previous topicNext topic

Return to “Plug-In Discussion”