PrefabFiles = { "treasure_world_traps", } local env = env GLOBAL.setfenv(1, GLOBAL) env.AddPlayerPostInit(function(inst) inst:AddComponent("trap_activator") end) env.AddPrefabPostInit("player_classified", function(inst) local function OnTrappedDirty(inst) local TheFocalPoint = TheFocalPoint local val = inst.net_trapped:value() if not TheFocalPoint then return end if val then TheFocalPoint.SoundEmitter:PlaySound("dontstarve/sanity/shadowhand_retreat", "retreat") else TheFocalPoint.SoundEmitter:KillSound("retreat") TheFocalPoint.SoundEmitter:PlaySound("dontstarve/sanity/bishop/hit_response") end end inst.net_trapped = net_bool(inst.GUID, "muts.net_trapped", "net_trapped_dirty") if not TheNet:IsDedicated() then inst:ListenForEvent("net_trapped_dirty", OnTrappedDirty) end end)