DSTMCreator Posted April 22, 2020 Share Posted April 22, 2020 (Sorry for my bad english again...) Hello everyone. Lua error message confused me and as result file with error wasn't even mentioned in error message. But I found this file and fix it. Now I got another error. Please help. ../mods/newdust/modmain.lua:117 attempt to index field "inst" (a nil value) LUA ERROR stack traceback: ../mods/newdust/modmain.lua:117 in (method) Visit (Lua) <114-120> And here is the code from modmain.lua: AddBrainPostInit("abigailbrain", function(self) local _atfn = self.inst.components.aura.auratestfn self.inst.components.aura.auratestfn = function(inst, target) if inst.cowardmode then return false end return _atfn(inst, target) end local _caav = self.bt.root.children[1].Visit self.bt.root.children[1].Visit = function(self) _caav(self) if self.status == GLOBAL.RUNNING then local leader = self.inst.components.follower.leader if leader and not self.inst:IsNear(leader, 15) then self.inst.cowardmode = true self.status = GLOBAL.FAILED self.inst.components.combat:GiveUp() self.inst.components.locomotor:Stop() return else self.inst.cowardmode = nil end end end local _offn = self.bt.root.children[2].Visit self.bt.root.children[2].Visit = function(self) _offn(self) if self.status == GLOBAL.SUCCESS then self.inst.cowardmode = nil -- HERE return end end end) Like in previous time I guess error is not in this file. But I dont know where exactly. It says self.inst is nil. Link to comment https://forums.kleientertainment.com/forums/topic/117534-modmainlua-attempt-to-index-field-inst-a-nil-value/ 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