[分享]饥荒联机版,支持局域网联机。

YN270-筋斗云(按键盘Z键召唤筋斗云在天上飞行,再按Z键落地)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七0.筋斗云(按键盘Z键召唤筋斗云在天上飞行,再按Z键落地) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/player_common.lua文件,在inst:AddComponent("resurrectable")的下一行插入以下内容: 5 6TheInput:AddKeyUpHandler(KEY_Z, function() 7 if not inst:HasTag("flycloud") then 8 inst:AddTag("flycloud") 9 inst.components.locomotor:Stop() 10 inst.components.talker:ShutUp() 11 SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) 12 inst.AnimState:PlayAnimation("give") 13 inst:DoTaskInTime(0.3, function() 14 inst.cloud = SpawnPrefab("corn_cooked") 15 inst.cloud.Physics:SetActive(false) 16 inst.cloud.Transform:SetScale(1.8, 1.8, 1.8) 17 inst.cloud.AnimState:SetMultColour(255/255,255/255,255/255,0.6) 18 inst.cloud.AnimState:SetBloomEffectHandle("shaders/anim.ksh") 19 inst.cloud:RemoveComponent("perishable") 20 inst.cloud:RemoveComponent("edible") 21 inst.cloud:RemoveComponent("stackable") 22 inst.cloud:RemoveComponent("inventoryitem") 23 inst.cloud:RemoveComponent("bait") 24 inst.cloud:RemoveComponent("tradable") 25 inst.cloud:RemoveComponent("burnable") 26 inst.cloud:RemoveComponent("propagator") 27 inst.cloud.persists = false 28 inst.cloud:AddTag("NOCLICK") 29 local follower = inst.cloud.entity:AddFollower() 30 follower:FollowSymbol( inst.GUID, "swap_body", 0, 60, 0 ) 31 local pt = inst:GetPosition() 32 inst.Transform:SetPosition(pt.x, 10, pt.z) 33 local shadow = inst.entity:AddDynamicShadow() 34 shadow:SetSize( 0, 0 ) 35 inst.gogogo = inst:DoPeriodicTask(.01, function() inst.Physics:SetMotorVelOverride(25,1.5,0) end) 36 end ) 37 else 38 inst:RemoveTag("flycloud") 39 inst.components.locomotor:Stop() 40 inst.components.talker:ShutUp() 41 SpawnPrefab("collapse_small").Transform:SetPosition(inst.Transform:GetWorldPosition()) 42 inst.AnimState:PlayAnimation("give") 43 inst:DoTaskInTime(0.3, function() 44 if inst.cloud then inst.cloud:Remove() inst.cloud = nil end 45 if inst.gogogo then inst.gogogo:Cancel() inst.gogogo = nil end 46 local pt = inst:GetPosition() 47 inst.Transform:SetPosition(pt.x, 0, pt.z) 48 local shadow = inst.entity:AddDynamicShadow() 49 shadow:SetSize( 1.3, .6 ) 50 inst.Physics:ClearMotorVelOverride() 51 inst.Physics:ClearMotorVelOverride() 52 end ) 53 end 54end ) 55 56 即可口中默念咒语——“走你”,并按下键盘Z键,召唤筋斗云在天上飞行,用键盘W、S、A、D键控制方向,再次按Z键可落地

2025/04/23 · Bny

YN271-全自动播种机(给避雷针植物,自动种下一百多个)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七一.全自动播种机(给避雷针植物,自动种下一百多个) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/lightningrod.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local slotpos = { Vector3(0,-75,0)} 7local function itemtest(inst, item, slot) 8 if item.prefab == "twigs" or item.prefab == "cutgrass" or item.prefab == "petals" or item.prefab == "petals_evil" or item.prefab == "cutreeds" or item.prefab == "red_cap" or item.prefab == "green_cap" or item.prefab == "blue_cap" or item.prefab == "carrot" or item.prefab == "berries" or item.prefab == "mandrake" or item.prefab == "foliage" or item.prefab == "cave_banana" or item.prefab == "cutlichen" or item.prefab == "lightbulb" or item.prefab == "pinecone" or item.prefab == "charcoal" or item.prefab == "acorn" or item.prefab == "cactus_meat" then 9 return true 10 end 11 return false 12end 13local widgetbuttoninfo = { 14 text = "Do", 15 position = Vector3(0, -145, 0), 16 fn = function(inst) 17 if GetPlayer().components.inventory:Has("goldnugget", 50) then 18 if inst.components.container:Has("twigs", 1) then 19 inst.components.container:ConsumeByName("twigs", 1) 20 inst.plants = "sapling" 21 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 22 end 23 if inst.components.container:Has("cutgrass", 1) then 24 inst.components.container:ConsumeByName("cutgrass", 1) 25 inst.plants = "grass" 26 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 27 end 28 if inst.components.container:Has("petals", 1) then 29 inst.components.container:ConsumeByName("petals", 1) 30 inst.plants = "flower" 31 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 32 end 33 if inst.components.container:Has("petals_evil", 1) then 34 inst.components.container:ConsumeByName("petals_evil", 1) 35 inst.plants = "flower_evil" 36 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 37 end 38 if inst.components.container:Has("cutreeds", 1) then 39 inst.components.container:ConsumeByName("cutreeds", 1) 40 inst.plants = "reeds" 41 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 42 end 43 if inst.components.container:Has("red_cap", 1) then 44 inst.components.container:ConsumeByName("red_cap", 1) 45 inst.plants = "red_mushroom" 46 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 47 end 48 if inst.components.container:Has("green_cap", 1) then 49 inst.components.container:ConsumeByName("green_cap", 1) 50 inst.plants = "green_mushroom" 51 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 52 end 53 if inst.components.container:Has("blue_cap", 1) then 54 inst.components.container:ConsumeByName("blue_cap", 1) 55 inst.plants = "blue_mushroom" 56 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 57 end 58 if inst.components.container:Has("carrot", 1) then 59 inst.components.container:ConsumeByName("carrot", 1) 60 inst.plants = "carrot_planted" 61 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 62 end 63 if inst.components.container:Has("berries", 1) then 64 inst.components.container:ConsumeByName("berries", 1) 65 inst.plants = "berrybush2" 66 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 67 end 68 if inst.components.container:Has("mandrake", 1) then 69 inst.components.container:ConsumeByName("mandrake", 1) 70 inst.plants = "mandrake" 71 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 72 end 73 if inst.components.container:Has("foliage", 1) then 74 inst.components.container:ConsumeByName("foliage", 1) 75 inst.plants = "cave_fern" 76 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 77 end 78 if inst.components.container:Has("cave_banana", 1) then 79 inst.components.container:ConsumeByName("cave_banana", 1) 80 inst.plants = "cave_banana_tree" 81 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 82 end 83 if inst.components.container:Has("cutlichen", 1) then 84 inst.components.container:ConsumeByName("cutlichen", 1) 85 inst.plants = "lichen" 86 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 87 end 88 if inst.components.container:Has("lightbulb", 1) then 89 inst.components.container:ConsumeByName("lightbulb", 1) 90 inst.plants = "flower_cave_triple" 91 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 92 end 93 if inst.components.container:Has("pinecone", 1) then 94 inst.components.container:ConsumeByName("pinecone", 1) 95 inst.plants = "evergreen_tall" 96 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 97 end 98 if inst.components.container:Has("charcoal", 1) then 99 inst.components.container:ConsumeByName("charcoal", 1) 100 inst.plants = "mushtree_tall" 101 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 102 end 103 if inst.components.container:Has("acorn", 1) then 104 inst.components.container:ConsumeByName("acorn", 1) 105 inst.plants = "deciduoustree_tall" 106 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 107 end 108 if inst.components.container:Has("cactus_meat", 1) then 109 inst.components.container:ConsumeByName("cactus_meat", 1) 110 inst.plants = "cactus" 111 GetPlayer().components.inventory:ConsumeByName("goldnugget", 50) 112 end 113 local pt = Vector3(inst.Transform:GetWorldPosition()) 114 inst:StartThread(function() 115 for k = 1, 25 do 116 local result_offset = FindValidPositionByFan(1 * 2 * PI, 4, 25, function(offset) 117 local x,y,z = (pt + offset):Get() 118 local ents = TheSim:FindEntities(x,y,z , 1) 119 return not next(ents) 120 end) 121 if result_offset then 122 local plant = SpawnPrefab(inst.plants) 123 plant.Transform:SetPosition((pt + result_offset):Get()) 124 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 125 local fx = SpawnPrefab("splash_ocean") 126 local pos = pt + result_offset 127 fx.Transform:SetPosition(pos.x, pos.y, pos.z) 128 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 129 end 130 Sleep(.33) 131 end 132 for k = 1, 37 do 133 local result_offset = FindValidPositionByFan(1 * 2 * PI, 6, 37, function(offset) 134 local x,y,z = (pt + offset):Get() 135 local ents = TheSim:FindEntities(x,y,z , 1) 136 return not next(ents) 137 end) 138 if result_offset then 139 local plant = SpawnPrefab(inst.plants) 140 plant.Transform:SetPosition((pt + result_offset):Get()) 141 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 142 local fx = SpawnPrefab("splash_ocean") 143 local pos = pt + result_offset 144 fx.Transform:SetPosition(pos.x, pos.y, pos.z) 145 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 146 end 147 Sleep(.23) 148 end 149 for k = 1, 50 do 150 local result_offset = FindValidPositionByFan(1 * 2 * PI, 8, 50, function(offset) 151 local x,y,z = (pt + offset):Get() 152 local ents = TheSim:FindEntities(x,y,z , 1) 153 return not next(ents) 154 end) 155 if result_offset then 156 local plant = SpawnPrefab(inst.plants) 157 plant.Transform:SetPosition((pt + result_offset):Get()) 158 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 159 local fx = SpawnPrefab("splash_ocean") 160 local pos = pt + result_offset 161 fx.Transform:SetPosition(pos.x, pos.y, pos.z) 162 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 163 end 164 Sleep(.13) 165 end 166 end) 167 end 168end } 169 inst:AddComponent("container") 170 inst.components.container:SetNumSlots(#slotpos) 171 inst.components.container.widgetslotpos = slotpos 172 inst.components.container.widgetpos = Vector3(0,180,0) 173 inst.components.container.side_align_tip = 160 174 inst.components.container.itemtestfn = itemtest 175 inst.components.container.acceptsstacks = false 176 inst.components.container.widgetbuttoninfo = widgetbuttoninfo 177 178 即可在空旷的地上建一个避雷针,鼠标左键点避雷针可打开格子,在格子中放入植物后点Do按钮,可自动种下100多株该植物,将花费50个黄金,身上黄金数不足时不会种植。可种植的17种植物有:给树枝种树苗、给草种草、给花瓣种花、给噩梦花瓣种噩梦花、给芦苇种芦苇、给红蘑菇种红蘑菇、给绿蘑菇种绿蘑菇、给蓝蘑菇种蓝蘑菇、给胡萝卜种胡萝卜、给浆果种果树丛、给曼德拉草种曼德拉草、给叶子种蕨类植物、给香蕉种香蕉树、给苔藓种苔藓、给荧光果种三朵洞穴花、给松果种树、给木炭种蘑菇树、给仙人掌肉种仙人掌、给橡果种橡树(橡树种下时不显示,存档退出再读档就可正常显示)。注意,其中果树丛、香蕉树、树、蘑菇树等种好后人无法通行,可以用“瑞士手杖”瞬移(或“神奇跳跃”跳出来),并用“收割者”大面积收获

2025/04/23 · Bny

YN272-智能播种机器人(将独奏乐器扔在地上自动种100棵香蕉树)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七二.智能播种机器人(将独奏乐器扔在地上自动种100棵香蕉树) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/onemanband.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function ondropped(inst) 7 local player = GetPlayer() 8 if player.components.inventory:Has("goldnugget", 50) then 9 player.components.inventory:ConsumeByName("goldnugget", 50) 10 RemovePhysicsColliders(inst) 11 inst.name = "cave_banana_tree" 12 inst.components.inventoryitem.canbepickedup = false 13 inst:DoTaskInTime(1, function() 14 inst.task = inst:DoPeriodicTask(.5, function() 15 inst.Physics:SetMotorVelOverride(2,0,2) 16 inst.Physics:ClearMotorVelOverride() 17 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 18 SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) 19 end) 20 end) 21 inst:DoTaskInTime(11, function() 22 if inst.task then inst.task:Cancel() inst.task = nil end 23 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 24 inst.Physics:SetMotorVelOverride(-3,0,3) 25 inst.Physics:ClearMotorVelOverride() 26 end) 27 inst:DoTaskInTime(12, function() 28 inst.task = inst:DoPeriodicTask(.5, function() 29 inst.Physics:SetMotorVelOverride(-2,0,-2) 30 inst.Physics:ClearMotorVelOverride() 31 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 32 SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) 33 end) 34 end) 35 inst:DoTaskInTime(22, function() 36 if inst.task then inst.task:Cancel() inst.task = nil end 37 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 38 inst.Physics:SetMotorVelOverride(-3,0,3) 39 inst.Physics:ClearMotorVelOverride() 40 end) 41 inst:DoTaskInTime(23, function() 42 inst.task = inst:DoPeriodicTask(.5, function() 43 inst.Physics:SetMotorVelOverride(2,0,2) 44 inst.Physics:ClearMotorVelOverride() 45 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 46 SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) 47 end) 48 end) 49 inst:DoTaskInTime(33, function() 50 if inst.task then inst.task:Cancel() inst.task = nil end 51 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 52 inst.Physics:SetMotorVelOverride(-3,0,3) 53 inst.Physics:ClearMotorVelOverride() 54 end) 55 inst:DoTaskInTime(34, function() 56 inst.task = inst:DoPeriodicTask(.5, function() 57 inst.Physics:SetMotorVelOverride(-2,0,-2) 58 inst.Physics:ClearMotorVelOverride() 59 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 60 SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) 61 end) 62 end) 63 inst:DoTaskInTime(44, function() 64 if inst.task then inst.task:Cancel() inst.task = nil end 65 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 66 inst.Physics:SetMotorVelOverride(-3,0,3) 67 inst.Physics:ClearMotorVelOverride() 68 end) 69 inst:DoTaskInTime(45, function() 70 inst.task = inst:DoPeriodicTask(.5, function() 71 inst.Physics:SetMotorVelOverride(2,0,2) 72 inst.Physics:ClearMotorVelOverride() 73 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 74 SpawnPrefab(inst.name).Transform:SetPosition(inst.Transform:GetWorldPosition()) 75 end) 76 end) 77 inst:DoTaskInTime(55, function() 78 if inst.task then inst.task:Cancel() inst.task = nil end 79 player.SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 80 inst.Physics:SetMotorVelOverride(-3,0,3) 81 inst.Physics:ClearMotorVelOverride() 82 inst.components.inventoryitem.canbepickedup = true 83 end) 84 end 85end 86 inst:ListenForEvent("ondropped", ondropped) 87 88 即可将独奏乐器扔在开阔的空地上,它会自动行驶种下100棵香蕉树(5行,每行20棵),同时收取主角50个黄金,身上黄金不足时不会干活。将其中的cave_banana_tree(洞穴香蕉树)改为其他植物,如flower_cave_triple(三朵洞穴花)等,就可以种其他植物了(见本修改技巧“常用物品中英文名称”)。独奏乐器在魔法选项(画着红骷髅)下,用2个黄金、4个噩梦燃料、2个猪皮制造

2025/04/23 · Bny

YN273-磁悬浮建筑机器人(将针线包扔在地上自动建50块农田)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七三.磁悬浮建筑机器人(将针线包扔在地上自动建50块农田) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/sewingkit.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function startbuild(inst) 7 inst.name = "fast_farmplot" 8 local space = 2.1 9 local row = 10 10 local num = 0 local num2 = 0 local num3 = 0 local num4 = 0 local num5 = 0 11 local pt = GetPlayer():GetPosition() 12 inst:StartThread(function() 13 for k = 1,row do 14 num = num + space 15 inst.Transform:SetPosition(pt.x+num, 5, pt.z+num) 16 SpawnPrefab(inst.name).Transform:SetPosition(pt.x+num, 0, pt.z+num) 17 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 18 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 19 Sleep(.5) 20 end 21 for k = 1,row do 22 num2 = num2 + space 23 inst.Transform:SetPosition(pt.x-2.6+num2, 5, pt.z+2.6+num2) 24 SpawnPrefab(inst.name).Transform:SetPosition(pt.x-2.6+num2, 0, pt.z+2.6+num2) 25 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 26 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 27 Sleep(.5) 28 end 29 for k = 1,row do 30 num3 = num3 + space 31 inst.Transform:SetPosition(pt.x-5.2+num3, 5, pt.z+5.2+num3) 32 SpawnPrefab(inst.name).Transform:SetPosition(pt.x-5.2+num3, 0, pt.z+5.2+num3) 33 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 34 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 35 Sleep(.5) 36 end 37 for k = 1,row do 38 num4 = num4 + space 39 inst.Transform:SetPosition(pt.x-7.8+num4, 5, pt.z+7.8+num4) 40 SpawnPrefab(inst.name).Transform:SetPosition(pt.x-7.8+num4, 0, pt.z+7.8+num4) 41 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 42 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 43 Sleep(.5) 44 end 45 for k = 1,row do 46 num5 = num5 + space 47 inst.Transform:SetPosition(pt.x-10.4+num5, 5, pt.z+10.4+num5) 48 SpawnPrefab(inst.name).Transform:SetPosition(pt.x-10.4+num5, 0, pt.z+10.4+num5) 49 GetPlayer().components.playercontroller:ShakeCamera(inst, "FULL", 0.2, 0.02, .25, 40) 50 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 51 Sleep(.5) 52 end 53 end) 54end 55local function ondropped(inst) 56 if GetPlayer().components.inventory:Has("goldnugget", 100) then 57 GetPlayer().components.inventory:ConsumeByName("goldnugget", 100) 58 GetPlayer().SoundEmitter:PlaySound("dontstarve/characters/wx78/levelup") 59 inst.components.inventoryitem.canbepickedup = false 60 inst.Physics:SetMotorVelOverride(0,2,0) 61 inst:DoTaskInTime(3, function() startbuild(inst) end) 62 inst:DoTaskInTime(28, function() 63 inst.Physics:ClearMotorVelOverride() 64 inst.components.inventoryitem.canbepickedup = true 65 GetPlayer().components.inventory:GiveItem(inst) 66 end) 67 end 68end 69 inst:ListenForEvent("ondropped", ondropped) 70 71 即可将针线包扔在开阔的空地上,它会悬浮在空中自动建50块农田,同时收取主角100个黄金,身上黄金不足时不会干活。将其中的fast_farmplot(高级农田)改为其他建筑,如cookpot(煮锅)、birdcage(鸟笼)等,就可以建其他建筑了(见本修改技巧“常用物品中英文名称”)。针线包在穿戴选项(画着礼帽)下,用1个木头、8个蛛丝、2个犬牙制造

2025/04/23 · Bny

YN274-电动斧子(拿黄金斧子自动放倒身边的树)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七四.电动斧子(拿黄金斧子自动放倒身边的树) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/axe.lua文件, 5 6 1.将下列内容: 7 8local function onequipgold(inst, owner) 9 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe") 10 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 11 owner.AnimState:Show("ARM_carry") 12 owner.AnimState:Hide("ARM_normal") 13end 14 15 替换为: 16 17local function pickup(inst, owner) 18 local range = 3 19 local pos = Vector3(owner.Transform:GetWorldPosition()) 20 local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) 21 for k,v in pairs(ents) do 22 if v:HasTag("tree") and v.components.workable and v.components.workable.workleft > 0 then 23 v.components.workable:Destroy(GetPlayer()) 24 end 25 end 26 inst.SoundEmitter:PlaySound("dontstarve/forest/treeCrumble") 27end 28local function onequipgold(inst, owner) 29 if owner.components.inventory:Has("lightbulb", 1) then 30 inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) 31 owner.components.inventory:ConsumeByName("lightbulb", 1) 32 end 33 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenaxe", "swap_goldenaxe") 34 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 35 owner.AnimState:Show("ARM_carry") 36 owner.AnimState:Hide("ARM_normal") 37end 38local function onunequipgold(inst, owner) 39 owner.AnimState:Hide("ARM_carry") 40 owner.AnimState:Show("ARM_normal") 41 if inst.task then inst.task:Cancel() inst.task = nil end 42end 43 44 45 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 46 47 即可拿黄金斧子自动放倒身边的树(类似电锯),效率极高,且不留树根,方便种新树。电动斧子需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动砍树了

2025/04/23 · Bny

YN275-电动镐(拿黄金镐自动凿开身边的石头)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七五.电动镐(拿黄金镐自动凿开身边的石头) 3 4 1.用MT管理器打开游戏目录/assets/scripts/prefabs/pickaxe.lua文件,将下列内容: 5 6local function onequipgold(inst, owner) 7 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe") 8 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 9 owner.AnimState:Show("ARM_carry") 10 owner.AnimState:Hide("ARM_normal") 11end 12 13 替换为: 14 15local function pickup(inst, owner) 16 local range = 3 17 local pos = Vector3(owner.Transform:GetWorldPosition()) 18 local ents = TheSim:FindEntities(pos.x,pos.y,pos.z, range) 19 for k,v in pairs(ents) do 20 if v.components.workable and v.components.workable.action == ACTIONS.MINE and v.components.workable.workleft > 0 then 21 v.components.workable:Destroy(GetPlayer()) 22 end 23 end 24 inst.SoundEmitter:PlaySound("dontstarve/wilson/rock_break") 25end 26local function onequipgold(inst, owner) 27 if owner.components.inventory:Has("lightbulb", 1) then 28 inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) 29 owner.components.inventory:ConsumeByName("lightbulb", 1) 30 end 31 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenpickaxe", "swap_goldenpickaxe") 32 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 33 owner.AnimState:Show("ARM_carry") 34 owner.AnimState:Hide("ARM_normal") 35end 36local function onunequipgold(inst, owner) 37 owner.AnimState:Hide("ARM_carry") 38 owner.AnimState:Show("ARM_normal") 39 if inst.task then inst.task:Cancel() inst.task = nil end 40end 41 42 43 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 44 45 即可拿黄金镐自动凿开身边的石头,效率极高,连大理石树、蜘蛛洞、远古雕像都可轻松凿平。电动镐需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动开矿了

2025/04/23 · Bny

YN276-电动草叉(拿草叉自动铲起脚下的地皮)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七六.电动草叉(拿草叉自动铲起脚下的地皮) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/pitchfork.lua文件,将下列内容: 5 6local function onequip(inst, owner) 7 owner.AnimState:OverrideSymbol("swap_object", "swap_pitchfork", "swap_pitchfork") 8 owner.AnimState:Show("ARM_carry") 9 owner.AnimState:Hide("ARM_normal") 10end 11 12local function onunequip(inst, owner) 13 owner.AnimState:Hide("ARM_carry") 14 owner.AnimState:Show("ARM_normal") 15end 16 17 替换为: 18 19local function pickup(inst, owner) 20 local pt = owner:GetPosition() 21 inst.components.terraformer:Terraform(pt) 22 inst.SoundEmitter:PlaySound("dontstarve/wilson/dig") 23end 24local function onequip(inst, owner) 25 if owner.components.inventory:Has("lightbulb", 1) then 26 inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) 27 owner.components.inventory:ConsumeByName("lightbulb", 1) 28 end 29 owner.AnimState:OverrideSymbol("swap_object", "swap_pitchfork", "swap_pitchfork") 30 owner.AnimState:Show("ARM_carry") 31 owner.AnimState:Hide("ARM_normal") 32end 33local function onunequip(inst, owner) 34 owner.AnimState:Hide("ARM_carry") 35 owner.AnimState:Show("ARM_normal") 36 if inst.task then inst.task:Cancel() inst.task = nil end 37end 38 39 即可拿草叉自动铲起脚下的地皮,效率极高,铲地的速度只取决于你走多快。电动草叉需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能,只能手动铲地了

2025/04/23 · Bny

YN277-电动铺路铲(拿黄金铲自动将脚下的空地皮铺成路)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七七.电动铺路铲(拿黄金铲自动将脚下的空地皮铺成路) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/shovel.lua文件, 5 6 1.将下列内容: 7 8local function onequipgold(inst, owner) 9 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenshovel", "swap_goldenshovel") 10 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 11 owner.AnimState:Show("ARM_carry") 12 owner.AnimState:Hide("ARM_normal") 13end 14 15 替换为: 16 17local function pickup(inst, owner) 18 inst.name = GROUND.ROAD 19 local pt = owner:GetPosition() 20 local ground = GetWorld() 21 local tile = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z) 22 if ground and tile == GROUND.DIRT then 23 local original_tile_type = ground.Map:GetTileAtPoint(pt.x, pt.y, pt.z) 24 local x, y = ground.Map:GetTileCoordsAtPoint(pt.x, pt.y, pt.z) 25 if x and y then 26 ground.Map:SetTile(x,y, inst.name) 27 ground.Map:RebuildLayer( original_tile_type, x, y ) 28 ground.Map:RebuildLayer( inst.name, x, y ) 29 end 30 local minimap = TheSim:FindFirstEntityWithTag("minimap") 31 if minimap then 32 minimap.MiniMap:RebuildLayer( original_tile_type, x, y ) 33 minimap.MiniMap:RebuildLayer( inst.name, x, y ) 34 end 35 end 36 inst.SoundEmitter:PlaySound("dontstarve/wilson/dig") 37end 38local function onequipgold(inst, owner) 39 if owner.components.inventory:Has("lightbulb", 1) then 40 inst.task = inst:DoPeriodicTask(.033, function() pickup(inst, owner) end) 41 owner.components.inventory:ConsumeByName("lightbulb", 1) 42 end 43 owner.AnimState:OverrideSymbol("swap_object", "swap_goldenshovel", "swap_goldenshovel") 44 owner.SoundEmitter:PlaySound("dontstarve/wilson/equip_item_gold") 45 owner.AnimState:Show("ARM_carry") 46 owner.AnimState:Hide("ARM_normal") 47end 48local function onunequipgold(inst, owner) 49 owner.AnimState:Hide("ARM_carry") 50 owner.AnimState:Show("ARM_normal") 51 if inst.task then inst.task:Cancel() inst.task = nil end 52end 53 54 55 2.在inst.components.equippable:SetOnEquip( onequipgold )的下一行插入inst.components.equippable:SetOnUnequip( onunequipgold ) 56 57 即可拿黄金铲自动将脚下的空地皮铺成路,效率极高,铺路的速度只取决于你走多快。电动铺路铲需要能源,每次装备时自动开启,会消耗1个荧光果,如果身上没有荧光果,则不会开启电动功能。将其中GROUND.ROAD(卵石路)替换为其他地皮名称,如GROUND.ROCKY(岩石地皮)、GROUND.DIRT(污垢地皮)、GROUND.SAVANNA(热带草原地皮)、GROUND.GRASS(长草地皮)、GROUND.FOREST(森林地皮)、GROUND.MARSH(沼泽地皮)、GROUND.WOODFLOOR(木质地板)、GROUND.CARPET(地毯地板)、GROUND.CHECKER(棋盘地板)、GROUND.CAVE(鸟粪地皮)、GROUND.FUNGUS(菌类地皮)、GROUND.FUNGUSRED(红菌类地皮)、GROUND.FUNGUSGREEN(绿菌类地皮)、GROUND.SINKHOLE(粘滑地皮)、GROUND.UNDERROCK(洞穴石地地皮)、GROUND.MUD(泥泞地皮),就可以自动铺其他地皮

2025/04/23 · Bny

YN278-地皮改造机(用排箫种地皮改造机,一次铺70块地皮)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七八.地皮改造机(用排箫种地皮改造机,一次铺70块地皮) 3 4 用MT管理器打开游戏目录/assets/scripts/prefabs/panflute.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function itemtest(inst, item, slot) 7 if item.prefab == "turf_road" or item.prefab == "turf_rocky" or item.prefab == "turf_forest" or item.prefab == "turf_marsh" or item.prefab == "turf_grass" or item.prefab == "turf_savanna" or item.prefab == "turf_dirt" or item.prefab == "turf_woodfloor" or item.prefab == "turf_carpetfloor" or item.prefab == "turf_checkerfloor" or item.prefab == "turf_cave" or item.prefab == "turf_fungus" or item.prefab == "turf_fungus_red" or item.prefab == "turf_fungus_green" or item.prefab == "turf_sinkhole" or item.prefab == "turf_underrock" or item.prefab == "turf_mud" then 8 return true 9 end 10 return false 11end 12local slotpos = { Vector3(0,-75,0)} 13local widgetbuttoninfo = { 14 text = "Do", 15 position = Vector3(0, -135, 0), 16 fn = function(inst) 17 if inst:HasTag("turfmachines") then 18 if not inst.components.container:IsEmpty() then 19 for k,v in pairs(inst.components.container.slots) do 20 if v and v.prefab == "turf_road" then inst.rug = GROUND.ROAD end 21 if v and v.prefab == "turf_rocky" then inst.rug = GROUND.ROCKY end 22 if v and v.prefab == "turf_forest" then inst.rug = GROUND.FOREST end 23 if v and v.prefab == "turf_marsh" then inst.rug = GROUND.MARSH end 24 if v and v.prefab == "turf_grass" then inst.rug = GROUND.GRASS end 25 if v and v.prefab == "turf_savanna" then inst.rug = GROUND.SAVANNA end 26 if v and v.prefab == "turf_dirt" then inst.rug = GROUND.DIRT end 27 if v and v.prefab == "turf_woodfloor" then inst.rug = GROUND.WOODFLOOR end 28 if v and v.prefab == "turf_carpetfloor" then inst.rug = GROUND.CARPET end 29 if v and v.prefab == "turf_checkerfloor" then inst.rug = GROUND.CHECKER end 30 if v and v.prefab == "turf_cave" then inst.rug = GROUND.CAVE end 31 if v and v.prefab == "turf_fungus" then inst.rug = GROUND.FUNGUS end 32 if v and v.prefab == "turf_fungus_red" then inst.rug = GROUND.FUNGUSRED end 33 if v and v.prefab == "turf_fungus_green" then inst.rug = GROUND.FUNGUSGREEN end 34 if v and v.prefab == "turf_sinkhole" then inst.rug = GROUND.SINKHOLE end 35 if v and v.prefab == "turf_underrock" then inst.rug = GROUND.UNDERROCK end 36 if v and v.prefab == "turf_mud" then inst.rug = GROUND.MUD end 37 v:Remove() 38 end 39 local pt = GetPlayer():GetPosition() 40 for y = 10, 0, -1 do 41 for x = 0, 10 do 42 local tile = GetWorld().Map:GetTileAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) 43 if tile ~= GROUND.IMPASSABLE then 44 local original_tile_type = GetWorld().Map:GetTileAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) 45 local x, y = GetWorld().Map:GetTileCoordsAtPoint(pt.x-2.1*x+2.1*y-10.5+10.5, pt.y, pt.z+2.1*x+2.1*y-10.5-10.5) 46 GetWorld().Map:SetTile(x,y, inst.rug) 47 GetWorld().Map:RebuildLayer( original_tile_type, x, y ) 48 GetWorld().Map:RebuildLayer( inst.rug, x, y ) 49 local minimap = TheSim:FindFirstEntityWithTag("minimap") 50 minimap.MiniMap:RebuildLayer( original_tile_type, x, y ) 51 minimap.MiniMap:RebuildLayer( inst.rug, x, y ) 52 end 53 end 54 end 55 end 56 end 57 end } 58local function OnDeploy (inst, pt) 59 local turfmachine = SpawnPrefab("panflute") 60 turfmachine.Transform:SetPosition(pt.x, pt.y, pt.z) 61 turfmachine.AnimState:SetBank("researchlab3") 62 turfmachine.AnimState:SetBuild("researchlab3") 63 turfmachine.AnimState:PlayAnimation("idle") 64 turfmachine.Transform:SetScale(0.5, 0.5, 0.5) 65 turfmachine:RemoveComponent("instrument") 66 turfmachine:RemoveComponent("tool") 67 if turfmachine.components.finiteuses then turfmachine:RemoveComponent("finiteuses") end 68 turfmachine:RemoveComponent("deployable") 69 turfmachine.components.container.canbeopened = true 70 turfmachine.components.inventoryitem:ChangeImageName("researchlab3") 71 turfmachine:AddComponent("equippable") 72 turfmachine.components.equippable.equipslot = EQUIPSLOTS.BODY 73 turfmachine.components.equippable:SetOnEquip( function(turfmachine) 74 GetPlayer().components.inventory:SetOverflow(turfmachine) 75 turfmachine.components.container:Open(GetPlayer()) 76 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") 77 end ) 78 turfmachine.components.equippable:SetOnUnequip( function(turfmachine) 79 turfmachine.components.container:Close(GetPlayer()) 80 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") 81 end ) 82 turfmachine:AddTag("turfmachines") 83 inst:Remove() 84end 85 inst:AddComponent("deployable") 86 inst.components.deployable.ondeploy = OnDeploy 87local function onsave(inst, data) 88 if inst:HasTag("turfmachines") then 89 data.turfmachines = true 90 end 91end 92local function onload(inst, data) 93 if data and data.turfmachines then 94 inst.AnimState:SetBank("researchlab3") 95 inst.AnimState:SetBuild("researchlab3") 96 inst.AnimState:PlayAnimation("idle") 97 inst.Transform:SetScale(0.5, 0.5, 0.5) 98 inst:RemoveComponent("instrument") 99 inst:RemoveComponent("tool") 100 if inst.components.finiteuses then inst:RemoveComponent("finiteuses") end 101 inst:RemoveComponent("deployable") 102 inst.components.container.canbeopened = true 103 inst.components.inventoryitem:ChangeImageName("researchlab3") 104 inst:AddComponent("equippable") 105 inst.components.equippable.equipslot = EQUIPSLOTS.BODY 106 inst.components.equippable:SetOnEquip( function(inst) 107 GetPlayer().components.inventory:SetOverflow(inst) 108 inst.components.container:Open(GetPlayer()) 109 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") 110 end ) 111 inst.components.equippable:SetOnUnequip( function(inst) 112 inst.components.container:Close(GetPlayer()) 113 GetPlayer().SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") 114 end ) 115 inst:AddTag("turfmachines") 116 end 117end 118 inst.OnSave = onsave 119 inst.OnLoad = onload 120 inst:AddComponent("container") 121 inst.components.container:SetNumSlots(#slotpos) 122 inst.components.container.widgetslotpos = slotpos 123 inst.components.container.widgetpos = Vector3(-80,150,0) 124 inst.components.container.side_widget = true 125 inst.components.container.itemtestfn = itemtest 126 inst.components.container.widgetbuttoninfo = widgetbuttoninfo 127 inst.components.container.acceptsstacks = false 128 inst.components.container.canbeopened = false 129 130 即可用排箫种地皮改造机,装备地皮改造机后,屏幕右侧将出现格子和按钮,在格子中放入1块地皮,按Do按钮,游戏会卡一下(5-10秒),70块地皮就铺好了,方便大面积改造地图。共支持17种地皮,只要可以放入格子的都可以铺。排箫在魔法选项(画着红骷髅)下用5个芦苇、1个曼德拉草、1个绳子制造

2025/04/23 · Bny

YN279-小型温室(用蝴蝶翅膀种小型温室,放入种子,10秒长出果实)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2二七九.小型温室(用蝴蝶翅膀种小型温室,放入种子,10秒长出果实) 3 4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/butterflywings.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 local oven = SpawnPrefab("butterflywings") 8 oven.Transform:SetPosition(pt.x, pt.y, pt.z) 9 oven.AnimState:SetBank("skull_chest") 10 oven.AnimState:SetBuild("skull_chest") 11 oven.AnimState:PlayAnimation("closed") 12 oven.Transform:SetScale(1.5, 1.5, 1.5) 13 oven:AddTag("fridge") 14 oven:AddTag("ovens") 15 oven:RemoveComponent("edible") 16 oven:RemoveComponent("tradable") 17 oven:RemoveComponent("stackable") 18 oven:RemoveComponent("inventoryitem") 19 oven:RemoveComponent("perishable") 20 oven:RemoveComponent("deployable") 21 oven:RemoveTag("cattoy") 22 oven:AddComponent("workable") 23 oven.components.workable:SetWorkAction(ACTIONS.HAMMER) 24 oven.components.workable:SetWorkLeft(3) 25 oven.components.workable:SetOnFinishCallback(function(oven) 26 SpawnPrefab("collapse_big").Transform:SetPosition(oven.Transform:GetWorldPosition()) 27 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 28 oven:Remove() 29 end ) 30 oven.components.container.canbeopened = true 31 inst.components.stackable:Get():Remove() 32end 33 inst:AddComponent("deployable") 34 inst.components.deployable.ondeploy = OnDeploy 35local function onsave(inst, data) 36 if inst:HasTag("ovens") then 37 data.ovens = true 38 end 39end 40local function onload(inst, data) 41 if data and data.ovens then 42 inst.AnimState:SetBank("skull_chest") 43 inst.AnimState:SetBuild("skull_chest") 44 inst.AnimState:PlayAnimation("closed") 45 inst.Transform:SetScale(1.5, 1.5, 1.5) 46 inst:AddTag("fridge") 47 inst:AddTag("ovens") 48 inst:RemoveComponent("edible") 49 inst:RemoveComponent("tradable") 50 inst:RemoveComponent("stackable") 51 inst:RemoveComponent("inventoryitem") 52 inst:RemoveComponent("perishable") 53 inst:RemoveComponent("deployable") 54 inst:RemoveTag("cattoy") 55 inst:AddComponent("workable") 56 inst.components.workable:SetWorkAction(ACTIONS.HAMMER) 57 inst.components.workable:SetWorkLeft(3) 58 inst.components.workable:SetOnFinishCallback(function(inst) 59 SpawnPrefab("collapse_big").Transform:SetPosition(inst.Transform:GetWorldPosition()) 60 GetPlayer().SoundEmitter:PlaySound("dontstarve/common/destroy_wood") 61 inst:Remove() 62 end ) 63 inst.components.container.canbeopened = true 64 end 65end 66local function itemtest(inst, item, slot) 67 if item.prefab == "carrot" or item.prefab == "corn" or item.prefab == "pumpkin" or item.prefab == "eggplant" or item.prefab == "durian" or item.prefab == "pomegranate" or item.prefab == "dragonfruit" or item.prefab == "carrot_seeds" or item.prefab == "corn_seeds" or item.prefab == "pumpkin_seeds" or item.prefab == "eggplant_seeds" or item.prefab == "durian_seeds" or item.prefab == "pomegranate_seeds" or item.prefab == "dragonfruit_seeds" or item.prefab == "seeds" or item.prefab == "spoiled_food" or item.prefab == "lightbulb" or item.prefab == "watermelon_seeds" or item.prefab == "watermelon" then 68 return true 69 end 70 return false 71end 72local slotpos = {} 73for y = 2, 0, -1 do 74 for x = 0, 14 do 75 table.insert(slotpos, Vector3(75*x-75*2+75, 75*y-75*2+75,0)) 76 end 77end 78 inst.OnSave = onsave 79 inst.OnLoad = onload 80 inst:AddComponent("container") 81local widgetbuttoninfo = { 82 text = "Start", 83 position = Vector3(450, -150, 0), 84 fn = function(inst) 85 if inst:HasTag("ovens") and inst.components.container:Has("lightbulb", 1) then 86 inst.components.container:ConsumeByName("lightbulb", 1) 87 inst.components.container:Close(GetPlayer()) 88 inst.components.container.canbeopened = false 89 inst.AnimState:SetBloomEffectHandle("shaders/anim.ksh") 90 inst:DoTaskInTime(10, function() 91 inst.AnimState:SetBloomEffectHandle("") 92 GetPlayer().SoundEmitter:PlaySound("dontstarve/HUD/research_available") 93 inst.components.container.canbeopened = true 94 for k,v in pairs(inst.components.container.slots) do 95 if v and v.prefab == "carrot_seeds" then 96 v:Remove() 97 local carrot = SpawnPrefab("carrot") 98 inst.components.container:GiveItem(carrot) 99 end 100 if v and v.prefab == "corn_seeds" then 101 v:Remove() 102 local corn = SpawnPrefab("corn") 103 inst.components.container:GiveItem(corn) 104 end 105 if v and v.prefab == "pumpkin_seeds" then 106 v:Remove() 107 local pumpkin = SpawnPrefab("pumpkin") 108 inst.components.container:GiveItem(pumpkin) 109 end 110 if v and v.prefab == "eggplant_seeds" then 111 v:Remove() 112 local eggplant = SpawnPrefab("eggplant") 113 inst.components.container:GiveItem(eggplant) 114 end 115 if v and v.prefab == "durian_seeds" then 116 v:Remove() 117 local durian = SpawnPrefab("durian") 118 inst.components.container:GiveItem(durian) 119 end 120 if v and v.prefab == "pomegranate_seeds" then 121 v:Remove() 122 local pomegranate = SpawnPrefab("pomegranate") 123 inst.components.container:GiveItem(pomegranate) 124 end 125 if v and v.prefab == "dragonfruit_seeds" then 126 v:Remove() 127 local dragonfruit = SpawnPrefab("dragonfruit") 128 inst.components.container:GiveItem(dragonfruit) 129 end 130 if v and v.prefab == "watermelon_seeds" then 131 v:Remove() 132 local watermelon = SpawnPrefab("watermelon") 133 inst.components.container:GiveItem(watermelon) 134 end 135 if v and v.prefab == "seeds" then 136 v:Remove() 137 local names = {"carrot","corn","pumpkin","eggplant","durian","pomegranate","dragonfruit","watermelon"} 138 local name = names[math.random(#names)] 139 local fruit = SpawnPrefab(name) 140 inst.components.container:GiveItem(fruit) 141 end 142 if v.prefab == "carrot" or v.prefab == "corn" or v.prefab == "pumpkin" or v.prefab == "eggplant" or v.prefab == "durian" or v.prefab == "pomegranate" or v.prefab == "dragonfruit" or v.prefab == "watermelon" then 143 v:Remove() 144 local spoiled = SpawnPrefab("spoiled_food") 145 inst.components.container:GiveItem(spoiled) 146 end 147 end 148 end ) 149 end 150 end } 151 inst.components.container.widgetbuttoninfo = widgetbuttoninfo 152 inst.components.container.acceptsstacks = false 153 inst.components.container:SetNumSlots(#slotpos) 154 inst.components.container.widgetslotpos = slotpos 155 inst.components.container.widgetpos = Vector3(-250,200,0) 156 inst.components.container.side_align_tip = 160 157 inst.components.container.canbeopened = false 158 inst.components.container.itemtestfn = itemtest 159 inst.components.container.onopenfn = function(inst) inst.AnimState:PlayAnimation("open") end 160 inst.components.container.onclosefn = function(inst) inst.AnimState:PlayAnimation("close") end 161 162 即可用蝴蝶翅膀种小型温室(拿着1个蝴蝶翅膀对地面点鼠标右键,如果拿着多个,则不会种出来),无论冬夏都可种植农作物。鼠标左键点小型温室,可打开格子。将种子放入格子,并放1个荧光果(提供电能)后,点格子下面的Start按钮,植物即开始生长(温室亮灯)。10秒后(温室灯灭)即可打开温室,收获你的果实吧。每次种植都将消耗1个荧光果,格子内没有荧光果时,温室不会工作。如果把果实留在格子内,并点Start按钮(仍须有荧光果),则10秒后果实变成腐烂食物,可用来快速生产肥料。不想要小型温室时,用锤子砸掉即可,记得先取出里面的物品哦。蝴蝶翅膀可打死蝴蝶获得

2025/04/23 · Bny