Jump to content

Recommended Posts

I'm sorry that the sentence is not smooth because I'm using a translator. 
This is a character mod I made. I have a dedicated bag. 
The problem is, there's nothing wrong with running this in my world, but when I open the bag on someone else's server, the game stops. The error log also points to the wrong file, not the mod file, so I don't know what the problem is. Help! I'm attaching the error log and file.

 

[00:21:20]: [string "scripts/widgets/containerwidget.lua"]:31: attempt to index local 'widget' (a nil value)
LUA ERROR stack traceback:
    scripts/widgets/containerwidget.lua:31 in (method) Open (Lua) <25-158>
    scripts/screens/playerhud.lua:379 in (upvalue) OpenContainerWidget (Lua) <364-385>
    scripts/screens/playerhud.lua:393 in (method) OpenContainer (Lua) <387-395>
    scripts/components/container_replica.lua:438 in (method) Open (Lua) <424-451>
    scripts/components/container_replica.lua:145 in (field) fn (Lua) <137-151>
    scripts/scheduler.lua:186 in (method) OnTick (Lua) <164-216>
    scripts/scheduler.lua:409 in (global) RunScheduler (Lua) <407-415>
    scripts/update.lua:240 in () ? (Lua) <224-298>
    

Captin (4).zip

You're using layout from containers.lua but you never required it in your modmain.lua, in modmain.lua just at the top paste this:

local containers = require("containers")

 

Edited by Mr.CrazyPotato

Put the following code below the line `local containers = require("containers")` in your modmain.lua.

local oldwidgetsetup = containers.widgetsetup
containers.widgetsetup = function(container, prefab, data)
    if not prefab and container.inst.prefab == "santapack" then
        prefab = "backpack"
    end
    oldwidgetsetup(container, prefab, data)
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...