rukoo Posted December 28, 2024 Share Posted December 28, 2024 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 Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/ Share on other sites More sharing options...
Mr.CrazyPotato Posted December 29, 2024 Share Posted December 29, 2024 (edited) 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 December 30, 2024 by Mr.CrazyPotato Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1782852 Share on other sites More sharing options...
rukoo Posted December 31, 2024 Author Share Posted December 31, 2024 Thank you for your answer! But still the same problem occurs... The game crashes when the user opens the bag. (The server's owner has no problem.) Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1783257 Share on other sites More sharing options...
yanecc Posted December 31, 2024 Share Posted December 31, 2024 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 Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1783280 Share on other sites More sharing options...
rukoo Posted January 1, 2025 Author Share Posted January 1, 2025 Thank you so much for your response! But still the same problem occurs... I am very sad. I am attaching the file again in case I entered the wrong code. Captin (5).zip Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1783424 Share on other sites More sharing options...
yanecc Posted January 1, 2025 Share Posted January 1, 2025 modmain.lua Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1783429 Share on other sites More sharing options...
rukoo Posted January 3, 2025 Author Share Posted January 3, 2025 thank so much!!! It is working good. you are my saivor. Link to comment https://forums.kleientertainment.com/forums/topic/162843-i-need-your-help-related-to-bag-items/#findComment-1783638 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now