Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local LocalPlayer = Players.LocalPlayer
- local Spawner = loadstring(game:HttpGet("https://gitlab.com/darkdark/dark/-/raw/main/Spawner.lua"))()
- getgenv().LocalSpawner = Spawner
- pcall(function() Spawner.Load() end)
- local DEBOUNCE = 0.4
- local processed = setmetatable({}, {__mode = "k"})
- local function setAttr(inst, key, val)
- if inst and inst.SetAttribute then
- pcall(function() inst:SetAttribute(key, val) end)
- end
- end
- local function enforcePetAttrs(inst)
- if not inst or not inst.Parent then return end
- setAttr(inst, "b", "l")
- setAttr(inst, "PET_UUID", "")
- end
- local function looksLikePet(inst)
- if not inst then return false end
- local ok, itemType = pcall(function() return inst:GetAttribute("ItemType") end)
- if ok and itemType == "Pet" then return true end
- if inst:IsA("Tool") then return true end
- return false
- end
- local function watchInstance(inst)
- if processed[inst] then return end
- processed[inst] = true
- if looksLikePet(inst) then
- enforcePetAttrs(inst)
- end
- -- Fixed with checks and pcall
- if inst and typeof(inst) == "Instance" and inst.GetAttributeChangedSignal then
- pcall(function()
- inst:GetAttributeChangedSignal("ItemType"):Connect(function()
- if looksLikePet(inst) then
- enforcePetAttrs(inst)
- end
- end)
- end)
- end
- end
- local function watchContainer(root)
- if not root then return end
- for _, d in root:GetDescendants() do
- watchInstance(d)
- end
- root.DescendantAdded:Connect(watchInstance)
- end
- watchContainer(workspace)
- watchContainer(LocalPlayer.Backpack)
- if LocalPlayer.Character then watchContainer(LocalPlayer.Character) end
- LocalPlayer.CharacterAdded:Connect(function(char)
- watchContainer(char)
- end)
- do
- local original = Spawner.SpawnPet
- if type(original) == "function" then
- Spawner.SpawnPet = function(name, kg, age, ...)
- local inst = original(name, kg, age, ...)
- if inst then
- pcall(function()
- enforcePetAttrs(inst)
- watchInstance(inst)
- for _, child in inst:GetChildren() do
- watchInstance(child)
- if looksLikePet(child) then enforcePetAttrs(child) end
- end
- end)
- end
- return inst
- end
- end
- end
- -- Fixed Notification initialization
- local GameEvents = ReplicatedStorage:FindFirstChild("GameEvents")
- local Notification = GameEvents and GameEvents:FindFirstChild("Notification")
- local BLOCKED = {
- "you are not holding a tool!",
- "you are not holding a tooi!",
- }
- local function contains(str, list)
- str = string.lower(str or "")
- for _, w in list do
- if str:find(w, 1, true) then
- return true
- end
- end
- return false
- end
- local function onPromptTriggered()
- if Notification and Notification.OnClientEvent then
- pcall(function()
- firesignal(Notification.OnClientEvent, "Gift sent!")
- end)
- task.wait(2)
- LocalPlayer:SetAttribute("IsTradingActive", true)
- task.wait(2)
- LocalPlayer:SetAttribute("IsTradingActive", false)
- task.wait(2)
- pcall(function()
- firesignal(Notification.OnClientEvent, "Trade Complete")
- end)
- end
- local tool = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Tool")
- if tool and tool:GetAttribute("b") == "l" then
- tool:Destroy()
- end
- end
- local hooked = {}
- local function hookPrompt(obj)
- if obj:IsA("ProximityPrompt") and not hooked[obj] then
- hooked[obj] = true
- obj.Triggered:Connect(onPromptTriggered)
- end
- end
- for _, d in workspace:GetDescendants() do
- hookPrompt(d)
- end
- workspace.DescendantAdded:Connect(hookPrompt)
- local pg = LocalPlayer:WaitForChild("PlayerGui")
- local function tryHide(inst)
- if inst:IsA("TextLabel") or inst:IsA("TextButton") then
- if contains(inst.Text, BLOCKED) then
- inst.Visible = false
- for _, s in inst.Parent:GetDescendants() do
- if s:IsA("Sound") then
- s.Volume = 0
- s:Stop()
- end
- end
- end
- elseif inst:IsA("Frame") then
- if contains(inst.Name, BLOCKED) then
- inst.Visible = false
- for _, s in inst:GetDescendants() do
- if s:IsA("Sound") then
- s.Volume = 0
- s:Stop()
- end
- end
- end
- elseif inst:IsA("Sound") then
- if contains(inst.Name, BLOCKED) then
- inst.Volume = 0
- inst:Stop()
- end
- end
- end
- for _, d in pg:GetDescendants() do
- tryHide(d)
- end
- pg.DescendantAdded:Connect(tryHide)
Advertisement
Add Comment
Please, Sign In to add comment