Blueberrys Posted February 7, 2015 Author Share Posted February 7, 2015 @bigpak, The code is 31 lines lone and your error says line 3986-3989. Are you sure that's the right file? Edit: But for the file you provided, you're missing an "end" to the "trade_fn" function at line 25-26. Fixed code.--Milkablefunction make_milkable(inst) inst:AddComponent("trader") inst.components.trader:SetAcceptTest(trade_test) inst.components.trader.onaccept = trade_fn inst.components.trader:Enable()endAddPrefabPostInit("beefalo", make_milkable)--Milkable--Milkable part 2function trade_test(inst, giver, item) if inst.components.sleeper:IsAsleep() then return false elseif item.components.tradable and item:HasTag("MILKBUCKET") then return true else return false endendfunction trade_fn(inst, giver, item) if giver and giver.components.inventory then giver.components.inventory:GiveItem("red_cap") endendfunction milktag(inst) inst:AddTag("MILKBUCKET")endEdit 2: I just realized why you gave only that portion, haha. Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.