YN132-靠近盆栽可补脑、可采蜂蜜,盆栽会发光

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三二.靠近盆栽可补脑、可采蜂蜜,盆栽会发光 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/pottedfern.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddTag("flower") inst:AddComponent("sanityaura") inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL inst:AddComponent("pickable") inst.components.pickable.picksound = "dontstarve/wilson/pickup_plants" inst.components.pickable:SetUp("honey", 30) local light = inst.entity:AddLight() light:SetFalloff(0.5) light:SetIntensity(.8) light:SetRadius(1.0) light:SetColour(146/255, 225/255, 146/255) light:Enable(true) 即可靠近盆栽可补脑、可采蜂蜜(30秒生一次),还会招蜂引蝶,发出微光,让你的家多一份温馨。盆栽在建造选项(画着锤子)下,用5个叶子、1个蜗牛壳碎片建造

2025/04/23 · Bny

YN133-牙齿陷阱自动重置(1秒自动重置)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三三.牙齿陷阱自动重置(1秒自动重置) 用MT管理器打开游戏目录/assets/scripts/prefabs/trap_teeth.lua文件,在 inst.components.finiteuses:Use(1)的下一行插入以下内容: end if inst.components.mine then inst:DoTaskInTime(1, function() inst.components.mine:Reset() end ) 即可让牙齿陷阱在触发后1秒钟自动重置。修改其中的1为任意数字,即可设置几秒钟自动重置

2025/04/23 · Bny

YN134-部署牙齿陷阱零距离

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三四.部署牙齿陷阱零距离 用MT管理器打开游戏目录/assets/scripts/prefabs/trap_teeth.lua文件,将inst.components.deployable.min_spacing = .75替换为inst.components.deployable.min_spacing = 0 即可在部署牙齿陷阱时没有最小距离限制

2025/04/23 · Bny

YN135-回旋镖自动接住且无限使用

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三五.回旋镖自动接住且无限使用 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boomerang.lua文件, 1.在owner.SoundEmitter:PlaySound("dontstarve/wilson/boomerang_return")的下一行插入owner.components.inventory:Equip(inst) 2.将下列内容: inst:AddComponent("finiteuses") inst.components.finiteuses:SetMaxUses(TUNING.BOOMERANG_USES) inst.components.finiteuses:SetUses(TUNING.BOOMERANG_USES) inst.components.finiteuses:SetOnFinished(OnFinished) 替换为: --inst:AddComponent("finiteuses") --inst.components.finiteuses:SetMaxUses(TUNING.BOOMERANG_USES) --inst.components.finiteuses:SetUses(TUNING.BOOMERANG_USES) --inst.components.finiteuses:SetOnFinished(OnFinished) 即可让回旋镖自动接住且无限使用

2025/04/23 · Bny

YN136-装备回旋镖召唤猎物(打猎游戏)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三六.装备回旋镖召唤猎物(打猎游戏) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/boomerang.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function cancreatelight(staff, caster, target, pos) local ground = GetWorld() if ground and pos then local tile = ground.Map:GetTileAtPoint(pos.x, pos.y, pos.z) return tile ~= GROUND.IMPASSIBLE and tile < GROUND.UNDERGROUND end return false end local function createlight(staff, target, pos) local names = {"crow","robin","robin_winter","frog","mosquito","bee","killerbee","butterfly","rabbit","babybeefalo"} local name = names[math.random(#names)] local prey = SpawnPrefab(name) prey.Transform:SetPosition(pos.x, pos.y, pos.z) end inst:AddComponent("spellcaster") inst.components.spellcaster:SetSpellFn(createlight) inst.components.spellcaster:SetSpellTestFn(cancreatelight) inst.components.spellcaster.canuseonpoint = true inst.components.spellcaster.canusefrominventory = false 即可在装备回旋镖后,在空地上点鼠标右键召唤猎物,包括鸟、昆虫、青蛙、兔子、小牛,尽情捕猎吧

2025/04/23 · Bny

YN137-一支吹箭用20次(按百分比使用)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三七.一支吹箭用20次(按百分比使用) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/blowdart.lua文件, 1.将下列内容: local function onhit(inst, attacker, target) local impactfx = SpawnPrefab("impact") if impactfx and attacker then local follower = impactfx.entity:AddFollower() follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0 ) impactfx:FacePoint(attacker.Transform:GetWorldPosition()) end inst:Remove() end 替换为: local function onfinished(inst) inst:Remove() end local function onhit(inst, attacker, target) local impactfx = SpawnPrefab("impact") if impactfx and attacker then local follower = impactfx.entity:AddFollower() follower:FollowSymbol(target.GUID, target.components.combat.hiteffectsymbol, 0, 0, 0 ) impactfx:FacePoint(attacker.Transform:GetWorldPosition()) end if inst.components.finiteuses.current > 0 then if inst.prefab == "blowdart_walrus" then inst:Remove() else attacker.components.inventory:Equip(inst) end end end 2.在inst:AddComponent("inspectable")的下一行插入以下内容: inst:AddComponent("finiteuses") inst.components.finiteuses:SetOnFinished( onfinished ) inst.components.finiteuses:SetMaxUses(20) inst.components.finiteuses:SetUses(20) 即可让一支吹箭使用20次,每次击中敌人后自动回到手中,可以修改其中2处数字20为想要的使用次数。不要与“吹箭无限使用(射中目标后自动回到手中)”一同修改

2025/04/23 · Bny

YN138-吹箭无限使用(射中目标后自动回到手中)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三八.吹箭无限使用(射中目标后自动回到手中) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/blowdart.lua文件,将下列内容: impactfx:FacePoint(attacker.Transform:GetWorldPosition()) end inst:Remove() 替换为: impactfx:FacePoint(attacker.Transform:GetWorldPosition()) end if inst.prefab == "blowdart_walrus" then inst:Remove() else attacker.components.inventory:Equip(inst) end 即可让吹箭射中目标后自动回到手中,不要与“一支吹箭用20次(按百分比使用)”一同修改

2025/04/23 · Bny

YN139-快速找到骨眼(骨眼在地图上显示)

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一三九.快速找到骨眼(骨眼在地图上显示) 用MT管理器打开游戏目录/assets/scripts/prefabs/chester_eyebone.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "chester.png" ) 即可在地图上看到骨眼的位置,显示为切斯特,生出切斯特后,则地图上有两个切斯特图标,一个是切斯特,一个是骨眼

2025/04/23 · Bny

YN140-切斯特(狗箱)跑得快

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一四0.切斯特(狗箱)跑得快 用MT管理器打开游戏目录/assets/scripts/prefabs/chester.lua文件,将下列内容: inst.components.locomotor.walkspeed = 3 inst.components.locomotor.runspeed = 7 替换为: inst.components.locomotor.walkspeed = 9 inst.components.locomotor.runspeed = 21 即可让切斯特运动速度提高3倍

2025/04/23 · Bny

YN141-切斯特(狗箱)不死

代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 一四一.切斯特(狗箱)不死 用MT管理器打开游戏目录/assets/scripts/prefabs/chester.lua文件,在inst:AddTag("noauradamage")的下一行插入inst.components.health:SetInvincible(true) 即可让切斯特不死

2025/04/23 · Bny