Hello! I'm a real beginner in Lua and programming. But I'd like to learn so here goes my first question!
I want to when I use /bs getsize to return the size of all bags you currently have unlocked. but I get the error
"...\Main.lua:16 : Attempting to index global 'BagspaceLeftFunction' (a nil value)"
I have marked line 16 with blue.
What I'm trying to do is to use the function BagspaceLeftFunction:BagSize() that is located in another file. Any ideas how to fix this?
-- Common imports.
--Just for clarification on what I'm doing, changing name on
--the Turbine.Shell Command() to BSCommand
BSCommand = Turbine.ShellCommand();
--Could put this inside the Execute function but decided on having
--it here instead take a look at line 18 on how I'm using it
return "This is the Help Command"
--adds the commands /bs or /bagspaceleft to lotro
--Here comes the real adding of commands to the plugin. for example
--"/bs bagsize" will call the command BagspaceLeft:BagSize() that lies in
function BSCommand:Execute( command, arguments)
if (arguments=="getsize") then
elseif (arguments == "help") then
--Welcome Message when loading the plugin
Turbine.Shell.WriteLine("BagspaceLeft by Lerusius");
local player = Turbine.Gameplay.LocalPlayer();
self.backpack = player:GetBackpack();