Exeus
Advanced OT User
- Joined
- Oct 8, 2012
- Messages
- 859
- Reaction score
- 198
Hi!
I need to access variable that has to be shared between two lua scripts
talkactions/a.lua
creaturescripts/b.lua
global.lua
unfortunely in a.lua it's always 1, meanwhile in b.lua it changes its value
how can I share that value between those files?
I tried using
or
in both of them, but both fail
I need to access variable that has to be shared between two lua scripts
talkactions/a.lua
Code:
for key, player in ipairs(players) do
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, tostring(GLOBAL_CURRENT_SOMETHING));
end
creaturescripts/b.lua
Code:
onLogin(player)
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, tostring(GLOBAL_CURRENT_SOMETHING));
GLOBAL_CURRENT_SOMETHING += 1;
global.lua
Code:
GLOBAL_CURRENT_SOMETHING = 1
unfortunely in a.lua it's always 1, meanwhile in b.lua it changes its value
how can I share that value between those files?
I tried using
local globals = require("global");
or
local globals = require("../../../global");
in both of them, but both fail
module 'global' not found:
Last edited: