YN360-无限刷洞穴(用石砖种洞穴入口,用铲子可挖掉洞穴入口)
代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 1 2三六0.无限刷洞穴(用石砖种洞穴入口,用铲子可挖掉洞穴入口) 3 4 1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutstone.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: 5 6local function OnDeploy (inst, pt) 7 SpawnPrefab("cave_entrance").Transform:SetPosition(pt.x, pt.y, pt.z) 8 inst.components.stackable:Get():Remove() 9end 10 inst:AddComponent("deployable") 11 inst.components.deployable.ondeploy = OnDeploy 12 13 14 2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cave_entrance.lua文件,将inst:RemoveComponent("workable")替换为以下内容: 15 16local function dig_up(inst, chopper) 17 inst:Remove() 18end 19 inst:AddComponent("workable") 20 inst.components.workable:SetWorkAction(ACTIONS.DIG) 21 inst.components.workable:SetOnFinishCallback(dig_up) 22 inst.components.workable:SetWorkLeft(1) 23 24 即可无限刷洞穴,在地面用石砖种洞穴入口将下到洞穴层,在洞穴层用石砖种洞穴入口将下到远古层,注意不要在远古层再种洞穴入口了。不需要该洞穴时,用铲子将洞口铲掉即可