Crestonia Posted June 29, 2015 Share Posted June 29, 2015 (edited) I'm having some trouble...A lot of people are crashing with my mod, and I know it has something to do with my character not being able to be hit by tallbirds.Here's what someone sent me: The following mod(s) have caused a failure: Crestonia[string "../mods/workshop-450068153/modmain.lua"]:62:attempt to index field 'combat' (a nil value)LUA ERROR stack traceback: ../mods/workshop-450068153/modmain.lua(62,1) =(tail call)? =[C] in function 'xpcall' scripts/mods/lua(144,1) in function 'mod' scripts/mainfunctions.lua(155,1)Does anyone know how to fix it?modmain.luacrestonia.lua Edited June 29, 2015 by Crestonia Link to comment https://forums.kleientertainment.com/forums/topic/55756-mod-issues/ Share on other sites More sharing options...
Kzisor Posted June 29, 2015 Share Posted June 29, 2015 (edited) @Crestonia, you're not checking to see if the code is running on client or the server. Components are not ran on clients.if not TheWorld.ismastersim then return instendAddPrefabPostInit("tallbird", function(inst) local old_sfn = inst.components.combat.SuggestTarget inst.components.combat.SuggestTarget = function(self, target) if target and target:HasTag("tallbird") then if target.components.combat.target ~= self.inst then return end end return old_sfn(self, target) endend) Edited June 29, 2015 by Kzisor Link to comment https://forums.kleientertainment.com/forums/topic/55756-mod-issues/#findComment-650800 Share on other sites More sharing options...
Crestonia Posted June 29, 2015 Author Share Posted June 29, 2015 @Kzisor So what do I do to make it run on the server? Or do I just take away the tallbird thing completely? Link to comment https://forums.kleientertainment.com/forums/topic/55756-mod-issues/#findComment-650801 Share on other sites More sharing options...
Kzisor Posted June 29, 2015 Share Posted June 29, 2015 @Crestonia, you add the code I provided above where you're calling components. Link to comment https://forums.kleientertainment.com/forums/topic/55756-mod-issues/#findComment-650803 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