Milllk Posted September 24, 2015 Share Posted September 24, 2015 local function ShouldAcceptOrNot(inst, item, giver) local hasenoughtwigs = false if giver.components.inventory:Has("twigs", 5) then hasenoughtwigs = true end local hasenoughgrass = false if giver.components.inventory:Has("cutgrass",5) then hasenoughgrass = true end local hasenoughberries = false if giver.components.inventory:Has("berries",5) then hasenoughberries = true end local acceptlist = item.components.tradable.goldvalue > 0 or item.prefab == "butterflywings" or item.prefab == "log" or item.prefab == "pinecone" or item.prefab == "acorn" or item.prefab == "red_cap" or item.prefab == "green_cap" or item.prefab == "blue_cap" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "carrot" or item.prefab == "seeds" or hasenoughgrass or hasenoughberries or hasenoughtwigs or item.prefab == "flint" or item.prefab == "nitre" or item.prefab == "ice" or item.prefab == "rocks" return acceptlist end ........ [some code between] ....... inst.components.trader:SetAcceptTest(ShouldAcceptOrNot) Link to comment Share on other sites More sharing options...
Milllk Posted September 24, 2015 Author Share Posted September 24, 2015 i gave the trader items it can accept everything..what's wrong with this code plz help Link to comment Share on other sites More sharing options...
Milllk Posted September 24, 2015 Author Share Posted September 24, 2015 sometimes work sometimes not Link to comment Share on other sites More sharing options...
Milllk Posted September 24, 2015 Author Share Posted September 24, 2015 (edited) I have more information when the host is using this mod character.then it works fine if not ,then this function doesn't work how can i fix? Edited September 24, 2015 by Milllk 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