-- ModuleScript Static (via bytefall decompiler) -- Decompiled using ByteFall -- discord.gg/pHTnqmmWzk local state = require(game.ReplicatedStorage.Modules.State) local util = require(game.ReplicatedStorage.Modules.Util) local maid = require(game.ReplicatedStorage.Modules.Maid) local LocalPlayer = game.Players.LocalPlayer function destroying_non_streaming(p1, p2) if p1.instance.Parent == nil then task.spawn(p2) util.warn("Object already destroyed: {name}", { name = p1.instance.Name }) return end p1.maid:add(p2) end function handle_parent_replication(p3, p4, p5, p6) if p3 and p4.paused then task.defer(function() if p4:get() then p5.Parent = game.ReplicatedStorage.Garbage return end p5.Parent = p6 end) end end return { create_global_object = function(p7) local v12 = state.new(nil) local v13 = state.new(false) local v14 = maid.new() local t1: {[any]: any} = { owner = v12, clean = v13, instance = p7, destroying = destroying_non_streaming, maid = v14 } p7.AncestryChanged:Connect(function() if p7.Parent == nil then t1.maid:clean() end end) v14 = p7.Parent local v16 = t1.clean:hook(function(p8, p9) if p8 then p7.Parent = game.ReplicatedStorage.Garbage elseif p8 ~= p9 then p7.Parent = v14 end end) t1:destroying(v16.unhook) util.hook_first_child(p7, "StateObject", function(p10) util.hook_child_added(p10, function(p11) local v30 = p11.Name if v30 == "remote" then t1.remote = p11 elseif v30 == "owner" then t1.owner:set_no_replication(p11.Value) p11.Changed:Connect(function(p12) t1.owner:set_no_replication(p12) end) elseif v30 == "clean" then t1.clean:set_no_replication(p11.Value) p11.Changed:Connect(function(p13) handle_parent_replication(p13, t1.clean, p7, v14) t1.clean:set_no_replication(p13) end) end end) end) t1.__index = t1 return t1 end, create_object = function(p14, p15, p16) local v20, v21 = p14.states(p15) local t2: {[any]: any} = { states = v20 } if v21 then for k, v in pairs(v21) do t2.states[k] = v end end t2.tag = p14.tag t2.values = {} setmetatable(t2, p16) util.hook_first_child(p15, p14.tag, function(p17) util.hook_child_added(p17, function(p18) local v32 = p18.Name local v33 = t2.states[v32] if v33 then if v33.fire then p18.OnClientEvent:Connect(function(...) v33:fire_no_replication(...) end) v33:hook(function(...) local v37 = t2.owner:get() local v38 = util.ownership(v37) if p18:GetAttribute("replicate") and v38 >= 1 then p16.remote:FireServer(v32, ...) end end, true) elseif not v33.dont_replicate then local v34 = util.ov(function() local taskWait = task.wait local networkPing = LocalPlayer:GetNetworkPing() taskWait(networkPing + 2) end) v34:done(function() v33:set_no_replication(p18.Value) end) v33:set_no_replication(p18.Value) p18.Changed:Connect(function(p19) if v34.running then return end v33:set_no_replication(p19) end) v33:hook(function(p20, p21) if p20 == p21 then return end t2.owner:get() if p16.remote and not v33.inc then if p18:GetAttribute("replicate") then p16.remote:FireServer(v32, p20) end v34() return end v33:set_no_replication(p18.Value) end, true) end t2.owner:hook(function(p22) local v45 = util.ownership(p22) if v45 == 1 or v45 == 3 then v33.inc = nil v33.rec = if v21 and v21[v32] then true else nil return end v33.inc = true v33.rec = nil end) end end) end) return t2 end }