Cunning fox Posted January 1, 2017 Share Posted January 1, 2017 (edited) Heya! Need some help with AddPrefabPostInit. My code is here: AddPrefabPostInit( "axe", function(inst) if GLOBAL.TheWorld.ismastersim then if inst:AddComponent("tool") then inst.components.tool:SetAction(ACTIONS.CHOP, 0.5) end end end ) The problem is that I now can't cut trees with axe :/ .What am I doing wrong? Edited January 1, 2017 by makar5000 1 Link to comment Share on other sites More sharing options...
Neu7ral Posted January 1, 2017 Share Posted January 1, 2017 (edited) Dunno, but the if inst:AddComponent("tool") then should be if inst.components.tool then maybe that fix your problem? Edited January 1, 2017 by Neutral_Steve Link to comment Share on other sites More sharing options...
Cunning fox Posted January 1, 2017 Author Share Posted January 1, 2017 10 minutes ago, Neutral_Steve said: Dunno, but the if inst:AddComponent("tool") then should be if inst.components.tool then maybe that fix your problem? Yeah, it's working now, thx 1 Link to comment 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