Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- script made by me universal
- if _G.UniversalHubRunning then return end
- _G.UniversalHubRunning = true
- local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
- local Window = Rayfield:CreateWindow({
- Name = "Dead Rails Hub",
- LoadingTitle = "Loading Dead Rails...",
- LoadingSubtitle = "[Lucky 28]",
- ConfigurationSaving = {
- Enabled = false,
- FolderName = nil,
- FileName = "DeadRails"
- }
- })
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- -- Tabs
- local MainTab = Window:CreateTab("Main")
- local NPCTab = Window:CreateTab("NPC Tools", 4483362458)
- local ItemTab = Window:CreateTab("Item Tools", 4483362458)
- local WorldTab = Window:CreateTab("World Tools", 4483362458)
- -- ==================== GLOBAL BRING POSITION ====================
- local BringDirection = "Front"
- local BringDirectionDropdown = NPCTab:CreateDropdown({
- Name = "Bring Position (NPCs & Players)",
- Options = {"Front", "Back", "Left", "Right", "Above"},
- CurrentOption = {"Front"},
- MultipleOptions = false,
- Flag = "BringDirection",
- Callback = function(Option)
- BringDirection = Option[1]
- end,
- })
- local function GetBringPosition()
- local player = game.Players.LocalPlayer
- local character = player.Character
- if not character or not character:FindFirstChild("HumanoidRootPart") then return nil end
- local rootPos = character.HumanoidRootPart.Position
- local rootCFrame = character.HumanoidRootPart.CFrame
- local offset = Vector3.new(0, 8, 0)
- if BringDirection == "Front" then
- offset = rootCFrame.LookVector * 6
- elseif BringDirection == "Back" then
- offset = rootCFrame.LookVector * -6
- elseif BringDirection == "Left" then
- offset = rootCFrame.RightVector * -6
- elseif BringDirection == "Right" then
- offset = rootCFrame.RightVector * 6
- elseif BringDirection == "Above" then
- offset = Vector3.new(0, 8, 0)
- end
- return rootPos + offset
- end
- -- ==================== NPC TOOLS TAB ====================
- local ScannedNPCs = {}
- local ESPNPCsEnabled = false
- local ESPConnections = {}
- local KillAuraEnabled = false
- local KillAuraRange = 10
- local KillAuraConnection
- local AutoBringNPCsEnabled = false
- local AutoBringNPCsConnection
- local AutoScanNPCsEnabled = false
- local AutoScanInterval = 5
- local BringRange = 100 -- Default bring range in studs
- -- New NPC Teleport Features (moved up for definition order)
- local SelectedNPC = nil
- local NPCList = {}
- local NPCTeleportIndex = 1 -- Tracks which NPC we are locked to (sequential)
- local NPCCFrameLockEnabled = false -- When true, continuously CFrame teleports us in front of NPC
- local NPCCFrameLockConnection = nil -- RunService connection for the lock
- local function UpdateNPCList()
- NPCList = {}
- for _, npc in ipairs(ScannedNPCs) do
- table.insert(NPCList, npc.Name)
- end
- end
- local function ScanNPCs()
- ScannedNPCs = {}
- -- Improved scanning: Find all Humanoids in workspace and check if their parent Model is not a player character
- for _, humanoid in ipairs(workspace:GetDescendants()) do
- if humanoid:IsA("Humanoid") then
- local model = humanoid.Parent
- if model and model:IsA("Model") then
- local isPlayer = false
- for _, player in ipairs(game.Players:GetPlayers()) do
- if player.Character == model then
- isPlayer = true
- break
- end
- end
- if not isPlayer then
- table.insert(ScannedNPCs, model)
- end
- end
- end
- end
- UpdateNPCList()
- if NPCDropdown then
- NPCDropdown:Refresh(NPCList)
- end
- end
- local function BringNPCs()
- local targetPos = GetBringPosition()
- if not targetPos then return end
- local playerPos = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
- for _, npc in ipairs(ScannedNPCs) do
- -- Improved bringing: Check for HumanoidRootPart, RootPart, or primary part
- local root = npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("RootPart") or npc.PrimaryPart
- if root then
- local dist = (playerPos - root.Position).Magnitude
- if dist <= BringRange then
- root.CFrame = CFrame.new(targetPos)
- end
- end
- end
- end
- local function KillNPCs()
- for _, npc in ipairs(ScannedNPCs) do
- local humanoid = npc:FindFirstChild("Humanoid")
- if humanoid and humanoid.Health > 0 then
- humanoid.Health = 0 -- Changed to direct health set for instant death
- end
- end
- end
- local function EnableKillAura()
- if KillAuraEnabled then
- KillAuraConnection = RunService.Heartbeat:Connect(function()
- local char = game.Players.LocalPlayer.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- local pos = char.HumanoidRootPart.Position
- for _, npc in ipairs(ScannedNPCs) do
- local root = npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("RootPart") or npc.PrimaryPart
- if root and (pos - root.Position).Magnitude <= KillAuraRange then
- local hum = npc:FindFirstChild("Humanoid")
- if hum and hum.Health > 0 then
- hum.Health = 0
- end
- end
- end
- end
- end)
- else
- if KillAuraConnection then KillAuraConnection:Disconnect() end
- end
- end
- local function EnableAutoBringNPCs()
- if AutoBringNPCsEnabled then
- AutoBringNPCsConnection = RunService.Heartbeat:Connect(BringNPCs)
- else
- if AutoBringNPCsConnection then AutoBringNPCsConnection:Disconnect() end
- end
- end
- local function EnableESPNPCs()
- if ESPNPCsEnabled then
- for _, npc in ipairs(ScannedNPCs) do
- if not ESPConnections[npc] then
- local billboard = Instance.new("BillboardGui")
- billboard.Adornee = npc:FindFirstChild("Head") or npc:FindFirstChild("HumanoidRootPart") or npc.PrimaryPart
- billboard.Size = UDim2.new(0, 100, 0, 100)
- billboard.StudsOffset = Vector3.new(0, 2, 0)
- billboard.AlwaysOnTop = true
- billboard.Parent = game.CoreGui
- local label = Instance.new("TextLabel", billboard)
- label.Text = npc.Name .. " (NPC)"
- label.Size = UDim2.new(1,0,1,0)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.new(1,0,0)
- label.TextScaled = true
- ESPConnections[npc] = billboard
- end
- end
- else
- for _, gui in pairs(ESPConnections) do gui:Destroy() end
- ESPConnections = {}
- end
- end
- local function TeleportToNPC(npcName)
- local localPlayer = game.Players.LocalPlayer
- local localChar = localPlayer.Character
- if not localChar or not localChar:FindFirstChild("HumanoidRootPart") then return end
- for _, npc in ipairs(ScannedNPCs) do
- if npc.Name == npcName then
- local root = npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("RootPart") or npc.PrimaryPart
- if root then
- local TweenDuration = 0.5 -- Default tween duration
- local tweenInfo = TweenInfo.new(TweenDuration, Enum.EasingStyle.Linear)
- local goal = {CFrame = root.CFrame * CFrame.new(0, 0, -2)}
- local tween = TweenService:Create(localChar.HumanoidRootPart, tweenInfo, goal)
- tween:Play()
- end
- break
- end
- end
- end
- -- Start CFrame lock: continuously teleports you in front of current NPC every frame
- -- Uses RunService so the game cannot pull you back. Stays locked until Turn OFF is pressed.
- local function StartNPCCFrameLock()
- if #ScannedNPCs == 0 then
- ScanNPCs()
- if #ScannedNPCs == 0 then
- Rayfield:Notify({
- Title = "No NPCs Found",
- Content = "Scan NPCs first, or no NPCs in the world.",
- Duration = 2,
- Image = 4483362458
- })
- return
- end
- end
- -- Wrap index around if it goes past the list
- if NPCTeleportIndex > #ScannedNPCs then
- NPCTeleportIndex = 1
- end
- NPCCFrameLockEnabled = true
- -- Disconnect any existing connection first
- if NPCCFrameLockConnection then
- NPCCFrameLockConnection:Disconnect()
- end
- local npc = ScannedNPCs[NPCTeleportIndex]
- Rayfield:Notify({
- Title = "CFrame LOCKED ON",
- Content = "NPC " .. tostring(NPCTeleportIndex) .. " / " .. tostring(#ScannedNPCs) .. ": " .. npc.Name .. "\nPress Turn OFF to release.",
- Duration = 3,
- Image = 4483362458
- })
- -- RunService Heartbeat: re-apply CFrame EVERY FRAME so game can't move you back
- NPCCFrameLockConnection = RunService.Heartbeat:Connect(function()
- if not NPCCFrameLockEnabled then return end
- -- Refresh NPC reference in case list changed
- if NPCTeleportIndex > #ScannedNPCs then
- NPCTeleportIndex = 1
- end
- if #ScannedNPCs == 0 then return end
- local currentNPC = ScannedNPCs[NPCTeleportIndex]
- if not currentNPC then return end
- local localPlayer = game.Players.LocalPlayer
- local localChar = localPlayer.Character
- if not localChar or not localChar:FindFirstChild("HumanoidRootPart") then return end
- local npcRoot = currentNPC:FindFirstChild("HumanoidRootPart") or currentNPC:FindFirstChild("RootPart") or currentNPC.PrimaryPart
- if npcRoot then
- -- Continuously set CFrame 3 studs INFRONT of the NPC
- -- This runs every frame, so you CANNOT move away until turned OFF
- localChar.HumanoidRootPart.CFrame = npcRoot.CFrame * CFrame.new(0, 0, -3)
- end
- end)
- end
- -- Stop CFrame lock: releases your character so you can move again
- local function StopNPCCFrameLock()
- NPCCFrameLockEnabled = false
- if NPCCFrameLockConnection then
- NPCCFrameLockConnection:Disconnect()
- NPCCFrameLockConnection = nil
- end
- Rayfield:Notify({
- Title = "CFrame Lock RELEASED",
- Content = "You can move freely again. Next lock will go to NPC #" .. tostring(NPCTeleportIndex + 1 > #ScannedNPCs and 1 or NPCTeleportIndex + 1),
- Duration = 2,
- Image = 4483362458
- })
- end
- -- Advance to next NPC (increments counter, does NOT change lock state)
- local function AdvanceToNextNPC()
- NPCTeleportIndex = NPCTeleportIndex + 1
- if NPCTeleportIndex > #ScannedNPCs then
- NPCTeleportIndex = 1
- end
- if NPCCFrameLockEnabled then
- -- If already locked, immediately start locking to the new NPC
- local npc = ScannedNPCs[NPCTeleportIndex]
- Rayfield:Notify({
- Title = "Locked to Next NPC",
- Content = "Now NPC " .. tostring(NPCTeleportIndex) .. " / " .. tostring(#ScannedNPCs) .. ": " .. npc.Name,
- Duration = 1.5,
- Image = 4483362458
- })
- else
- Rayfield:Notify({
- Title = "Advanced Counter",
- Content = "Next lock will target NPC #" .. tostring(NPCTeleportIndex),
- Duration = 1.5,
- Image = 4483362458
- })
- end
- end
- -- Added Freeze Aura
- local FreezeAuraEnabled = false
- local FreezeAuraRange = 10
- local FreezeAuraConnection
- local function EnableFreezeAura()
- if FreezeAuraEnabled then
- FreezeAuraConnection = RunService.Heartbeat:Connect(function()
- local char = game.Players.LocalPlayer.Character
- if char and char:FindFirstChild("HumanoidRootPart") then
- local pos = char.HumanoidRootPart.Position
- for _, npc in ipairs(ScannedNPCs) do
- local root = npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("RootPart") or npc.PrimaryPart
- if root and root:IsA("BasePart") then
- local dist = (pos - root.Position).Magnitude
- if dist <= FreezeAuraRange then
- root.Anchored = true
- else
- root.Anchored = false
- end
- end
- end
- end
- end)
- else
- if FreezeAuraConnection then FreezeAuraConnection:Disconnect() end
- -- Unanchor all NPCs when disabled
- for _, npc in ipairs(ScannedNPCs) do
- local root = npc:FindFirstChild("HumanoidRootPart") or npc:FindFirstChild("RootPart") or npc.PrimaryPart
- if root and root:IsA("BasePart") then
- root.Anchored = false
- end
- end
- end
- end
- -- NPC Controls
- NPCTab:CreateButton({
- Name = "Scan NPCs",
- Callback = function()
- ScanNPCs()
- end
- })
- NPCTab:CreateToggle({
- Name = "Auto Scan NPCs",
- CurrentValue = false,
- Callback = function(Value)
- AutoScanNPCsEnabled = Value
- if Value then
- coroutine.wrap(function()
- while AutoScanNPCsEnabled do
- ScanNPCs()
- UpdateNPCList()
- if NPCDropdown then NPCDropdown:Refresh(NPCList) end
- wait(AutoScanInterval)
- end
- end)()
- end
- end,
- })
- NPCTab:CreateInput({
- Name = "Auto Scan Interval (sec)",
- PlaceholderText = "Enter seconds (1 - 30)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- AutoScanInterval = math.clamp(num, 1, 30)
- end
- end,
- })
- NPCTab:CreateInput({
- Name = "Bring Range (studs)",
- PlaceholderText = "Enter range (20 - 100)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- BringRange = math.clamp(num, 20, 100)
- end
- end,
- })
- NPCTab:CreateButton({
- Name = "Bring Nearby NPCs",
- Callback = BringNPCs
- })
- NPCTab:CreateToggle({
- Name = "Auto Bring Nearby NPCs",
- CurrentValue = false,
- Callback = function(Value)
- AutoBringNPCsEnabled = Value
- EnableAutoBringNPCs()
- end,
- })
- NPCTab:CreateButton({
- Name = "Kill All NPCs",
- Callback = KillNPCs
- })
- -- NEW BUTTON: Load FE NPC Script
- NPCTab:CreateButton({
- Name = "Load FE NPC Script",
- Callback = function()
- loadstring(game:HttpGet("https://raw.githubusercontent.com/randomstring0/fe-source/refs/heads/main/NPC/source/main.Luau"))()
- end
- })
- NPCTab:CreateToggle({
- Name = "Kill Aura NPCs",
- CurrentValue = false,
- Callback = function(Value)
- KillAuraEnabled = Value
- EnableKillAura()
- end,
- })
- NPCTab:CreateInput({
- Name = "Kill Aura Range",
- PlaceholderText = "Enter range (5 - 50)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- KillAuraRange = math.clamp(num, 5, 50)
- end
- end,
- })
- NPCTab:CreateToggle({
- Name = "Freeze Aura NPCs",
- CurrentValue = false,
- Callback = function(Value)
- FreezeAuraEnabled = Value
- EnableFreezeAura()
- end,
- })
- NPCTab:CreateInput({
- Name = "Freeze Aura Range",
- PlaceholderText = "Enter range (5 - 50)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- FreezeAuraRange = math.clamp(num, 5, 50)
- end
- end,
- })
- NPCTab:CreateToggle({
- Name = "ESP NPCs",
- CurrentValue = false,
- Callback = function(Value)
- ESPNPCsEnabled = Value
- EnableESPNPCs()
- end,
- })
- coroutine.wrap(function()
- while wait(1) do
- if ESPNPCsEnabled then EnableESPNPCs() end
- end
- end)()
- local NPCDropdown = NPCTab:CreateDropdown({
- Name = "Select NPC",
- Options = NPCList,
- CurrentOption = {},
- Callback = function(Option) SelectedNPC = Option[1] end,
- })
- NPCTab:CreateButton({
- Name = "Teleport to Selected NPC",
- Callback = function()
- if SelectedNPC then TeleportToNPC(SelectedNPC) end
- end,
- })
- NPCTab:CreateButton({
- Name = "Turn ON: CFrame Lock to NPC",
- Callback = StartNPCCFrameLock
- })
- NPCTab:CreateButton({
- Name = "Turn OFF: Release CFrame Lock",
- Callback = StopNPCCFrameLock
- })
- NPCTab:CreateButton({
- Name = "Next NPC (Advance Counter)",
- Callback = AdvanceToNextNPC
- })
- NPCTab:CreateButton({
- Name = "Reset NPC Counter to #1",
- Callback = function()
- NPCTeleportIndex = 1
- Rayfield:Notify({
- Title = "Counter Reset",
- Content = "Next lock will start from NPC #1.",
- Duration = 2,
- Image = 4483362458
- })
- end
- })
- -- ==================== ITEM TOOLS TAB ====================
- local itemNames = {
- "chestplate", "helmet", "left_pauldron", "right_pauldron", "mining_helmet", "lincoln's_top_hat", "lincoln's_ghost's_top_hat",
- "sack", "horse_cart", "saddle", "sheet_metal", "barbed_wire", "lightning_rod", "lantern", "camera", "banjo", "bandage", "snake_oil", "glass_bottle", "strange_mask", "easter_egg", "revive", "chair", "ladder", "campfire",
- "crucifix", "gold_bar", "gold_nugget", "gold_statue", "gold_painting", "gold_cup", "gold_plate", "gold_watch", "silver_bar", "silver_nugget", "silver_statue", "silver_painting", "silver_cup", "silver_plate", "silver_watch", "stone_statue", "wooden_painting", "fool's_gold",
- "barrel", "rope", "wheel", "book", "newspaper", "tumbleweed", "rock", "vase", "teapot",
- "coal", "entity_corpses", "wanted_poster",
- "bond", "ripped_bond", "strange_map", "jade_tablet", "brain_in_jar", "werewolf_limb", "strange_machine", "supply_depot_key", "fool's_key", "golden_egg", "jack_o'lantern",
- "notes", "poster", "crate", "present", "money", "bonds", "star_points",
- "shovel", "axe", "hammer", "pickaxe", "tomahawk", "cavalry_sword", "sword", "excalibur", "jade_sword", "vampire_knife", "spear", "spear_of_longinus",
- "revolver", "mauser", "navy_revolver", "flintlock_pistol", "sawed-off_shotgun", "shotgun", "blunderbuss", "revolving_rifle", "rifle", "bolt-action_rifle", "elephant_rifle", "springfield_rifle", "crossbow", "firework_gun", "electrocutioner", "thompson", "maxim_gun", "ballista", "cannon", "tesla_cannon",
- "holy_water", "molotov", "bear_trap", "acid_mine", "acid_barrel", "holy_hand_grenade", "landmine", "dynamite", "gunpowder_barrel", "bottle_rocket_launcher",
- "arrows", "revolver_ammo", "shotgun_shells", "rifle_ammo", "firework_ammo", "turret_ammo", "ballista_bolt", "cannon_balls",
- "water", "kerosene", "milk", "blood", "zombie_blood", "unicorn_blood", "angel_tears", "devil_tears", "primordial_soup", "cerebrus_blood", "fire", "acid"
- }
- local ScannedItems = {}
- local ESPItemsEnabled = false
- local ESPItemConnections = {}
- local AutoBringItemsEnabled = false
- local AutoBringItemsConnection
- local AutoScanItemsEnabled = false
- local AutoScanItemsInterval = 5
- local BringItemRange = 100
- local SelectedItem = nil
- local ItemList = {}
- local function UpdateItemList()
- ItemList = {}
- for _, item in ipairs(ScannedItems) do
- table.insert(ItemList, item.Name)
- end
- end
- local function ScanItems()
- ScannedItems = {}
- for _, obj in ipairs(workspace:GetDescendants()) do
- if table.find(itemNames, obj.Name:lower()) and not obj:IsDescendantOf(game.Players.LocalPlayer.Character) and (obj:IsA("Tool") or obj:IsA("Model") or obj:IsA("BasePart")) then
- table.insert(ScannedItems, obj)
- end
- end
- UpdateItemList()
- if ItemDropdown then
- ItemDropdown:Refresh(ItemList)
- end
- end
- local function BringItems()
- local targetPos = GetBringPosition()
- if not targetPos then return end
- local playerPos = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
- for _, item in ipairs(ScannedItems) do
- local root = (item:IsA("BasePart") and item) or item:FindFirstChildWhichIsA("BasePart", true) or item.PrimaryPart or item.Handle
- if root then
- local dist = (playerPos - root.Position).Magnitude
- if dist <= BringItemRange then
- root.CFrame = CFrame.new(targetPos)
- end
- end
- end
- end
- local function EnableAutoBringItems()
- if AutoBringItemsEnabled then
- AutoBringItemsConnection = RunService.Heartbeat:Connect(BringItems)
- else
- if AutoBringItemsConnection then AutoBringItemsConnection:Disconnect() end
- end
- end
- local function EnableESPItems()
- if ESPItemsEnabled then
- for _, item in ipairs(ScannedItems) do
- if not ESPItemConnections[item] then
- local adornee = (item:IsA("BasePart") and item) or item:FindFirstChildWhichIsA("BasePart", true) or item.PrimaryPart or item.Handle
- if adornee then
- local billboard = Instance.new("BillboardGui")
- billboard.Adornee = adornee
- billboard.Size = UDim2.new(0, 100, 0, 100)
- billboard.StudsOffset = Vector3.new(0, 2, 0)
- billboard.AlwaysOnTop = true
- billboard.Parent = game.CoreGui
- local label = Instance.new("TextLabel", billboard)
- label.Text = item.Name .. " (Item)"
- label.Size = UDim2.new(1,0,1,0)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.new(0,1,0)
- label.TextScaled = true
- ESPItemConnections[item] = billboard
- end
- end
- end
- else
- for _, gui in pairs(ESPItemConnections) do gui:Destroy() end
- ESPItemConnections = {}
- end
- end
- local function TeleportToItem(itemName)
- local localPlayer = game.Players.LocalPlayer
- local localChar = localPlayer.Character
- if not localChar or not localChar:FindFirstChild("HumanoidRootPart") then return end
- for _, item in ipairs(ScannedItems) do
- if item.Name == itemName then
- local root = (item:IsA("BasePart") and item) or item:FindFirstChildWhichIsA("BasePart", true) or item.PrimaryPart or item.Handle
- if root then
- local TweenDuration = 0.5
- local tweenInfo = TweenInfo.new(TweenDuration, Enum.EasingStyle.Linear)
- local goal = {CFrame = root.CFrame * CFrame.new(0, 0, -2)}
- local tween = TweenService:Create(localChar.HumanoidRootPart, tweenInfo, goal)
- tween:Play()
- end
- break
- end
- end
- end
- local function BringSelectedItem()
- if not SelectedItem then return end
- local targetPos = GetBringPosition()
- if not targetPos then return end
- for _, item in ipairs(ScannedItems) do
- if item.Name == SelectedItem then
- local root = (item:IsA("BasePart") and item) or item:FindFirstChildWhichIsA("BasePart", true) or item.PrimaryPart or item.Handle
- if root then
- root.CFrame = CFrame.new(targetPos)
- end
- break
- end
- end
- end
- -- Item Controls
- ItemTab:CreateButton({
- Name = "Scan Items",
- Callback = function()
- ScanItems()
- end
- })
- ItemTab:CreateToggle({
- Name = "Auto Scan Items",
- CurrentValue = false,
- Callback = function(Value)
- AutoScanItemsEnabled = Value
- if Value then
- coroutine.wrap(function()
- while AutoScanItemsEnabled do
- ScanItems()
- UpdateItemList()
- if ItemDropdown then ItemDropdown:Refresh(ItemList) end
- wait(AutoScanItemsInterval)
- end
- end)()
- end
- end,
- })
- ItemTab:CreateInput({
- Name = "Auto Scan Interval (sec)",
- PlaceholderText = "Enter seconds (1 - 30)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- AutoScanItemsInterval = math.clamp(num, 1, 30)
- end
- end,
- })
- ItemTab:CreateInput({
- Name = "Bring Range (studs)",
- PlaceholderText = "Enter range (20 - 100)",
- RemoveTextAfterFocusLost = false,
- Callback = function(Text)
- local num = tonumber(Text)
- if num then
- BringItemRange = math.clamp(num, 20, 100)
- end
- end,
- })
- ItemTab:CreateButton({
- Name = "Bring Nearby Items",
- Callback = BringItems
- })
- ItemTab:CreateToggle({
- Name = "Auto Bring Nearby Items",
- CurrentValue = false,
- Callback = function(Value)
- AutoBringItemsEnabled = Value
- EnableAutoBringItems()
- end,
- })
- ItemTab:CreateToggle({
- Name = "ESP Items",
- CurrentValue = false,
- Callback = function(Value)
- ESPItemsEnabled = Value
- EnableESPItems()
- end,
- })
- coroutine.wrap(function()
- while wait(1) do
- if ESPItemsEnabled then EnableESPItems() end
- end
- end)()
- local ItemDropdown = ItemTab:CreateDropdown({
- Name = "Select Item",
- Options = ItemList,
- CurrentOption = {},
- Callback = function(Option) SelectedItem = Option[1] end,
- })
- ItemTab:CreateButton({
- Name = "Bring Selected Item",
- Callback = function()
- BringSelectedItem()
- end,
- })
- ItemTab:CreateButton({
- Name = "Teleport to Selected Item",
- Callback = function()
- if SelectedItem then TeleportToItem(SelectedItem) end
- end,
- })
- -- ==================== GETNIL HELPER FUNCTION ====================
- local function GetNil(Name, DebugId)
- for _, Object in getnilinstances() do
- if Object.Name == Name and Object:GetDebugId() == DebugId then
- return Object
- end
- end
- end
- -- ==================== BOXING GLOVES ====================
- local autoBoxingGlovesEnabled = false
- local BoxingGlovesRechargeEnabled = false
- local BoxingGlovesToggle = MainTab:CreateToggle({
- Name = "Auto Boxing Gloves (Swing Only)",
- CurrentValue = false,
- Flag = "AutoBoxingGlovesToggle",
- Callback = function(Value)
- autoBoxingGlovesEnabled = Value
- if autoBoxingGlovesEnabled then
- coroutine.wrap(function()
- while autoBoxingGlovesEnabled do
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local gloves = character:FindFirstChild("Boxing Gloves")
- if gloves then
- local args = {
- gloves,
- 1787477308.1938,
- Vector3.new(0.76200979948044, -0.4384982585907, -0.47650834918022)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- else
- -- Try GetNil fallback
- local nilGloves = GetNil("Boxing Gloves", "1_310037")
- if nilGloves then
- local args = {
- nilGloves,
- 1787477308.1938,
- Vector3.new(0.76200979948044, -0.4384982585907, -0.47650834918022)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- end
- end
- end
- task.wait(0.01)
- end
- end)()
- end
- end,
- })
- MainTab:CreateToggle({
- Name = "Boxing Gloves Auto Recharge",
- CurrentValue = false,
- Flag = "BoxingGlovesRechargeToggle",
- Callback = function(Value)
- BoxingGlovesRechargeEnabled = Value
- end,
- })
- -- Boxing Gloves charge loop
- coroutine.wrap(function()
- while task.wait(0.01) do
- if BoxingGlovesRechargeEnabled then
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local gloves = character:FindFirstChild("Boxing Gloves")
- if gloves then
- local args = {
- gloves,
- 1787477307.4144
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- else
- -- Try GetNil fallback
- local nilGloves = GetNil("Boxing Gloves", "1_310037")
- if nilGloves then
- local args = {
- nilGloves,
- 1787477307.4144
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- end
- end
- end
- end
- end
- end)()
- local autoSwingEnabled = false
- local swingSpeed = 0.01 -- Default speed in seconds (adjustable)
- local autoShovelEnabled = false
- local ShovelRechargeEnabled = false -- Separate shovel recharge toggle
- local autoExcaliburEnabled = false
- local ExcaliburRechargeEnabled = false -- Separate excalibur recharge toggle
- local autoSpearEnabled = false
- local SpearRechargeEnabled = false -- Separate spear recharge toggle
- local enlargeEnabled = false
- local hitboxSize = 10
- local connections = {}
- local function isZombie(obj)
- return obj:IsA("Model") and obj:FindFirstChild("Humanoid") and obj:FindFirstChild("HumanoidRootPart") and string.find(obj.Name:lower(), "zombie")
- end
- local Toggle = MainTab:CreateToggle({
- Name = "Auto Swing Melee (Vampire Knife)",
- CurrentValue = false,
- Flag = "AutoSwingToggle",
- Callback = function(Value)
- autoSwingEnabled = Value
- if autoSwingEnabled then
- coroutine.wrap(function()
- while autoSwingEnabled do
- local args = {
- game:GetService("Players").LocalPlayer.Character:WaitForChild("Vampire Knife"),
- os.clock() * 1000, -- Using current time as approximation; adjust if needed
- Vector3.new(0.38748157024383545, -0.469262033700943, 0.7935056090354919)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- task.wait(swingSpeed)
- end
- end)()
- end
- end,
- })
- local Slider = MainTab:CreateSlider({
- Name = "Swing Speed (seconds)",
- Range = {0.01, 1.0},
- Increment = 0.01,
- Suffix = "s",
- CurrentValue = 0.01,
- Flag = "SwingSpeedSlider",
- Callback = function(Value)
- swingSpeed = Value
- end,
- })
- local ShovelToggle = MainTab:CreateToggle({
- Name = "Auto Shovel (Swing Only)",
- CurrentValue = false,
- Flag = "AutoShovelToggle",
- Callback = function(Value)
- autoShovelEnabled = Value
- if autoShovelEnabled then
- coroutine.wrap(function()
- while autoShovelEnabled do
- local args = {
- game:GetService("Players").LocalPlayer.Character:WaitForChild("Shovel"),
- 1768150910.657773,
- Vector3.new(-0.8638443350791931, -0.3981878459453583, -0.3085765242576599)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- task.wait(0.01)
- end
- end)()
- end
- end,
- })
- -- Separate Shovel Recharge toggle (like Vampire Knife)
- MainTab:CreateToggle({
- Name = "Shovel Auto Recharge",
- CurrentValue = false,
- Flag = "ShovelRechargeToggle",
- Callback = function(Value)
- ShovelRechargeEnabled = Value
- end,
- })
- local ExcaliburToggle = MainTab:CreateToggle({
- Name = "Auto Excalibur (Swing Only)",
- CurrentValue = false,
- Flag = "AutoExcaliburToggle",
- Callback = function(Value)
- autoExcaliburEnabled = Value
- if autoExcaliburEnabled then
- coroutine.wrap(function()
- while autoExcaliburEnabled do
- local args = {
- game:GetService("Players").LocalPlayer.Character:WaitForChild("Excalibur"),
- 1768326713.962643,
- Vector3.new(0.6278625130653381, -0.5555389523506165, 0.5451285243034363)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- task.wait(0.01)
- end
- end)()
- end
- end,
- })
- -- Separate Excalibur Recharge toggle (like Vampire Knife)
- MainTab:CreateToggle({
- Name = "Excalibur Auto Recharge",
- CurrentValue = false,
- Flag = "ExcaliburRechargeToggle",
- Callback = function(Value)
- ExcaliburRechargeEnabled = Value
- end,
- })
- -- ==================== SPEAR OF LONGINUS ====================
- local SpearToggle = MainTab:CreateToggle({
- Name = "Auto Spear of Longinus (Swing Only)",
- CurrentValue = false,
- Flag = "AutoSpearToggle",
- Callback = function(Value)
- autoSpearEnabled = Value
- if autoSpearEnabled then
- coroutine.wrap(function()
- while autoSpearEnabled do
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local spear = character:FindFirstChild("Spear of Longinus")
- if spear then
- local args = {
- spear,
- 1787412804.5943,
- Vector3.new(0.83802497386932, -0.51521301269531, 0.17963778972626)
- }
- game:GetService("ReplicatedStorage"):WaitForChild("Shared"):WaitForChild("Universe"):WaitForChild("Network"):WaitForChild("RemoteEvent"):WaitForChild("SwingMelee"):FireServer(unpack(args))
- end
- end
- task.wait(0.01)
- end
- end)()
- end
- end,
- })
- MainTab:CreateToggle({
- Name = "Spear of Longinus Auto Recharge",
- CurrentValue = false,
- Flag = "SpearRechargeToggle",
- Callback = function(Value)
- SpearRechargeEnabled = Value
- end,
- })
- local SliderHitbox = MainTab:CreateSlider({
- Name = "Hitbox Size",
- Range = {1, 50},
- Increment = 1,
- Suffix = "studs",
- CurrentValue = 10,
- Flag = "HitboxSizeSlider",
- Callback = function(Value)
- hitboxSize = Value
- end,
- })
- local ToggleEnlarge = MainTab:CreateToggle({
- Name = "Enlarge Zombie Hitboxes",
- CurrentValue = false,
- Flag = "EnlargeHitboxToggle",
- Callback = function(Value)
- enlargeEnabled = Value
- if enlargeEnabled then
- for _, obj in ipairs(workspace:GetChildren()) do
- if isZombie(obj) then
- obj.HumanoidRootPart.Size = Vector3.new(hitboxSize, hitboxSize, hitboxSize / 2)
- obj.HumanoidRootPart.Transparency = 0.5
- end
- end
- local conn = workspace.ChildAdded:Connect(function(child)
- if enlargeEnabled and isZombie(child) then
- task.wait(0.1)
- if child:FindFirstChild("HumanoidRootPart") then
- child.HumanoidRootPart.Size = Vector3.new(hitboxSize, hitboxSize, hitboxSize / 2)
- child.HumanoidRootPart.Transparency = 0.5
- end
- end
- end)
- table.insert(connections, conn)
- else
- for _, obj in ipairs(workspace:GetChildren()) do
- if isZombie(obj) then
- obj.HumanoidRootPart.Size = Vector3.new(2, 2, 1)
- obj.HumanoidRootPart.Transparency = 0
- end
- end
- for _, conn in ipairs(connections) do
- conn:Disconnect()
- end
- connections = {}
- end
- end,
- })
- -- ==================== UNIFIED TRAIN TELEPORT SYSTEM ====================
- -- All supported train types
- local TrainNames = {
- "ghost",
- "presidential",
- "default",
- "yeat",
- "christmas_event_2025",
- "dracula",
- "frost",
- "wooden",
- "armor",
- "passenger",
- "cattle",
- "locomotive"
- }
- -- Unified function to teleport to a specific train's conductor seat
- local function TeleportToTrain(trainName)
- local player = game:GetService("Players").LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local root = character:WaitForChild("HumanoidRootPart")
- local train = workspace:FindFirstChild(trainName)
- if not train then
- Rayfield:Notify({
- Title = "Searching",
- Content = "Looking for " .. trainName .. " train...",
- Duration = 30,
- Image = 4483362458
- })
- local start = tick()
- while not train and tick() - start < 30 do
- task.wait(1)
- train = workspace:FindFirstChild(trainName)
- end
- if not train then
- Rayfield:Notify({
- Title = "Error",
- Content = trainName .. " train not found after 30 seconds.",
- Duration = 5,
- Image = 4483362458
- })
- return
- end
- end
- local seatPath = train:WaitForChild("RequiredComponents"):WaitForChild("Controls"):WaitForChild("ConductorSeat"):WaitForChild("VehicleSeat")
- root.CFrame = seatPath.CFrame + Vector3.new(0, 3, 0)
- wait(0.1)
- humanoid:Sit(seatPath)
- end
- -- Smart teleport: finds any available train and teleports to it
- local function TeleportToAnyTrain()
- local player = game:GetService("Players").LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local root = character:WaitForChild("HumanoidRootPart")
- -- Try each train in order
- for _, trainName in ipairs(TrainNames) do
- local train = workspace:FindFirstChild(trainName)
- if train then
- local seatPath = train:FindFirstChild("RequiredComponents")
- and train.RequiredComponents:FindFirstChild("Controls")
- and train.RequiredComponents.Controls:FindFirstChild("ConductorSeat")
- and train.RequiredComponents.Controls.ConductorSeat:FindFirstChild("VehicleSeat")
- if seatPath then
- root.CFrame = seatPath.CFrame + Vector3.new(0, 3, 0)
- wait(0.1)
- humanoid:Sit(seatPath)
- Rayfield:Notify({
- Title = "Teleported",
- Content = "Teleported to " .. trainName .. " conductor seat.",
- Duration = 3,
- Image = 4483362458
- })
- return
- end
- end
- end
- -- If no train found immediately, wait and search
- Rayfield:Notify({
- Title = "Searching",
- Content = "Looking for any train...",
- Duration = 30,
- Image = 4483362458
- })
- local start = tick()
- while tick() - start < 30 do
- for _, trainName in ipairs(TrainNames) do
- local train = workspace:FindFirstChild(trainName)
- if train then
- local seatPath = train:FindFirstChild("RequiredComponents")
- and train.RequiredComponents:FindFirstChild("Controls")
- and train.RequiredComponents.Controls:FindFirstChild("ConductorSeat")
- and train.RequiredComponents.Controls.ConductorSeat:FindFirstChild("VehicleSeat")
- if seatPath then
- root.CFrame = seatPath.CFrame + Vector3.new(0, 3, 0)
- wait(0.1)
- humanoid:Sit(seatPath)
- Rayfield:Notify({
- Title = "Teleported",
- Content = "Teleported to " .. trainName .. " conductor seat.",
- Duration = 3,
- Image = 4483362458
- })
- return
- end
- end
- end
- task.wait(1)
- end
- Rayfield:Notify({
- Title = "Error",
- Content = "No train found after 30 seconds.",
- Duration = 5,
- Image = 4483362458
- })
- end
- -- ==================== SCREEN TELEPORT ICON (Top-Right) ====================
- local function CreateTeleportIcon()
- local player = game:GetService("Players").LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- -- Remove existing if already present
- if playerGui:FindFirstChild("TrainTeleportIcon") then
- playerGui.TrainTeleportIcon:Destroy()
- end
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "TrainTeleportIcon"
- screenGui.ResetOnSpawn = false
- screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- screenGui.DisplayOrder = 100
- -- Main button container (top-right)
- local button = Instance.new("TextButton")
- button.Name = "TeleportButton"
- button.Size = UDim2.new(0, 60, 0, 60)
- button.Position = UDim2.new(1, -75, 0, 15) -- Top-right corner with margin
- button.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- button.BackgroundTransparency = 0.2
- button.BorderSizePixel = 0
- button.AutoLocalize = false
- button.Text = ""
- -- Rounded corners
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 12)
- corner.Parent = button
- -- Stroke outline
- local stroke = Instance.new("UIStroke")
- stroke.Color = Color3.fromRGB(255, 200, 50)
- stroke.Thickness = 2
- stroke.Parent = button
- -- Train icon (text-based emoji-like icon)
- local iconLabel = Instance.new("TextLabel")
- iconLabel.Name = "IconLabel"
- iconLabel.Size = UDim2.new(1, 0, 0.7, 0)
- iconLabel.Position = UDim2.new(0, 0, 0, 0)
- iconLabel.BackgroundTransparency = 1
- iconLabel.Text = "TRAIN"
- iconLabel.TextSize = 14
- iconLabel.TextColor3 = Color3.fromRGB(255, 220, 80)
- iconLabel.Font = Enum.Font.SourceSansBold
- iconLabel.Parent = button
- -- Label below icon
- local textLabel = Instance.new("TextLabel")
- textLabel.Name = "TextLabel"
- textLabel.Size = UDim2.new(1, 0, 0.3, 0)
- textLabel.Position = UDim2.new(0, 0, 0.7, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.Text = "SEAT"
- textLabel.TextSize = 10
- textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- textLabel.Font = Enum.Font.SourceSansBold
- textLabel.Parent = button
- -- Hover effect
- button.MouseEnter:Connect(function()
- button.BackgroundColor3 = Color3.fromRGB(60, 60, 80)
- stroke.Color = Color3.fromRGB(255, 230, 100)
- end)
- button.MouseLeave:Connect(function()
- button.BackgroundColor3 = Color3.fromRGB(40, 40, 50)
- stroke.Color = Color3.fromRGB(255, 200, 50)
- end)
- -- Click effect
- button.MouseButton1Down:Connect(function()
- button.Size = UDim2.new(0, 55, 0, 55)
- button.Position = UDim2.new(1, -72, 0, 17)
- end)
- button.MouseButton1Up:Connect(function()
- button.Size = UDim2.new(0, 60, 0, 60)
- button.Position = UDim2.new(1, -75, 0, 15)
- end)
- -- Click action: teleport to conductor seat
- button.MouseButton1Click:Connect(function()
- TeleportToAnyTrain()
- end)
- button.Parent = screenGui
- screenGui.Parent = playerGui
- end
- -- Create the icon when script loads
- coroutine.wrap(CreateTeleportIcon)()
- -- Also recreate on character added in case it gets destroyed
- game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function()
- task.wait(2)
- CreateTeleportIcon()
- end)
- -- ==================== TRAIN TELEPORT BUTTONS ====================
- MainTab:CreateButton({
- Name = "Teleport to Ghost Train Conductor Seat",
- Callback = function() TeleportToTrain("ghost") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Presidential Conductor Seat",
- Callback = function() TeleportToTrain("presidential") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Default Train Conductor Seat",
- Callback = function() TeleportToTrain("default") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Yeat Train Conductor Seat",
- Callback = function() TeleportToTrain("yeat") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Christmas Event 2025 Conductor Seat",
- Callback = function() TeleportToTrain("christmas_event_2025") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Dracula Train Conductor Seat",
- Callback = function() TeleportToTrain("dracula") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Frost Train Conductor Seat",
- Callback = function() TeleportToTrain("frost") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Wooden Train Conductor Seat",
- Callback = function() TeleportToTrain("wooden") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Armor Train Conductor Seat",
- Callback = function() TeleportToTrain("armor") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Passenger Train Conductor Seat",
- Callback = function() TeleportToTrain("passenger") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Cattle Train Conductor Seat",
- Callback = function() TeleportToTrain("cattle") end,
- })
- MainTab:CreateButton({
- Name = "Teleport to Locomotive Train Conductor Seat",
- Callback = function() TeleportToTrain("locomotive") end,
- })
- -- ==================== VAMPIRE KNIFE RECHARGE (NOW TOGGLEABLE) ====================
- local RechargeEnabled = true -- Default ON like before
- local RechargeToggle = MainTab:CreateToggle({
- Name = "Vampire Knife Auto Recharge",
- CurrentValue = true,
- Flag = "RechargeToggle",
- Callback = function(Value)
- RechargeEnabled = Value
- end,
- })
- -- Vampire knife charge loop (toggleable)
- coroutine.wrap(function()
- while task.wait(0.01) do
- if RechargeEnabled then
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local vampireKnife = character:FindFirstChild("Vampire Knife")
- if vampireKnife then
- local args = {
- vampireKnife,
- 1768151606.210378
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- end
- end
- end
- end
- end)()
- -- Shovel charge loop (separate toggleable)
- coroutine.wrap(function()
- while task.wait(0.01) do
- if ShovelRechargeEnabled then
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local shovel = character:FindFirstChild("Shovel")
- if shovel then
- local args = {
- shovel,
- 1768150909.257726
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- end
- end
- end
- end
- end)()
- -- Excalibur charge loop (separate toggleable)
- coroutine.wrap(function()
- while task.wait(0.01) do
- if ExcaliburRechargeEnabled then
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local excalibur = character:FindFirstChild("Excalibur")
- if excalibur then
- local args = {
- excalibur,
- 1768326712.974426
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- end
- end
- end
- end
- end)()
- -- Spear of Longinus charge loop (separate toggleable)
- coroutine.wrap(function()
- while task.wait(0.01) do
- if SpearRechargeEnabled then
- local character = game:GetService("Players").LocalPlayer.Character
- if character then
- local spear = character:FindFirstChild("Spear of Longinus")
- if spear then
- local args = {
- spear,
- 1787412803.4539
- }
- local remoteEvent = game:GetService("ReplicatedStorage"):FindFirstChild("Shared")
- and game:GetService("ReplicatedStorage").Shared:FindFirstChild("Universe")
- and game:GetService("ReplicatedStorage").Shared.Universe:FindFirstChild("Network")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network:FindFirstChild("RemoteEvent")
- and game:GetService("ReplicatedStorage").Shared.Universe.Network.RemoteEvent:FindFirstChild("ChargeMelee")
- if remoteEvent then
- remoteEvent:FireServer(unpack(args))
- end
- end
- end
- end
- end
- end)()
- -- ============================================================
- -- ==================== WORLD TOOLS TAB =======================
- -- ============================================================
- -- (Lever ESP removed - not working)
- -- ==================== TOWNS ITEM BRINGER (RunService) ====================
- local TownsItems = {} -- [item] = true (tracked items)
- local TownsItemList = {} -- list of unique item names for dropdown
- local SelectedTownsItem = nil
- local TownsItemDropdown = nil
- local TownsScanConnection = nil
- local TownsAutoBringEnabled = false
- local TownsAutoBringConnection = nil
- local LastTownsScan = 0
- local function GetItemRoot(obj)
- if obj:IsA("BasePart") then return obj end
- if obj:IsA("Model") then return obj.PrimaryPart or obj:FindFirstChildWhichIsA("BasePart", true) end
- return obj:FindFirstChild("Handle") or obj:FindFirstChildWhichIsA("BasePart", true)
- end
- local function IsValidTownItem(obj)
- if not table.find(itemNames, obj.Name:lower()) then return false end
- if obj:IsDescendantOf(game.Players.LocalPlayer.Character) then return false end
- if not (obj:IsA("Tool") or obj:IsA("Model") or obj:IsA("BasePart")) then return false end
- return true
- end
- local function ScanTownsItems()
- local towns = workspace:FindFirstChild("Towns")
- if not towns then return end
- local foundItems = {}
- local foundNames = {}
- for _, obj in ipairs(towns:GetDescendants()) do
- if IsValidTownItem(obj) then
- foundItems[obj] = true
- foundNames[obj.Name] = true
- end
- end
- TownsItems = foundItems
- local newList = {}
- for name, _ in pairs(foundNames) do
- table.insert(newList, name)
- end
- table.sort(newList)
- if #newList ~= #TownsItemList then
- TownsItemList = newList
- if TownsItemDropdown then
- TownsItemDropdown:Refresh(TownsItemList)
- end
- else
- local same = true
- table.sort(TownsItemList)
- for i, v in ipairs(TownsItemList) do
- if newList[i] ~= v then same = false break end
- end
- if not same then
- TownsItemList = newList
- if TownsItemDropdown then
- TownsItemDropdown:Refresh(TownsItemList)
- end
- end
- end
- end
- local function BringTownsItemByName(itemName)
- local targetPos = GetBringPosition()
- if not targetPos then
- Rayfield:Notify({
- Title = "Error",
- Content = "Character not found.",
- Duration = 2,
- Image = 4483362458
- })
- return
- end
- local brought = 0
- for item, _ in pairs(TownsItems) do
- if item.Name == itemName then
- local root = GetItemRoot(item)
- if root then
- root.CFrame = CFrame.new(targetPos)
- brought = brought + 1
- end
- end
- end
- if brought > 0 then
- Rayfield:Notify({
- Title = "Item Brought",
- Content = "Brought " .. brought .. "x " .. itemName .. " to you.",
- Duration = 2,
- Image = 4483362458
- })
- else
- Rayfield:Notify({
- Title = "Not Found",
- Content = itemName .. " not found in any town right now.",
- Duration = 2,
- Image = 4483362458
- })
- end
- end
- local function BringAllTownsItems()
- local targetPos = GetBringPosition()
- if not targetPos then
- Rayfield:Notify({
- Title = "Error",
- Content = "Character not found.",
- Duration = 2,
- Image = 4483362458
- })
- return
- end
- local brought = 0
- for item, _ in pairs(TownsItems) do
- local root = GetItemRoot(item)
- if root then
- root.CFrame = CFrame.new(targetPos)
- brought = brought + 1
- end
- end
- Rayfield:Notify({
- Title = "Items Brought",
- Content = "Brought " .. brought .. " items from all towns.",
- Duration = 2,
- Image = 4483362458
- })
- end
- local function StartTownsScanner()
- if TownsScanConnection then return end
- TownsScanConnection = RunService.Heartbeat:Connect(function()
- local now = tick()
- if now - LastTownsScan >= 0.5 then
- LastTownsScan = now
- ScanTownsItems()
- end
- end)
- end
- local function StopTownsScanner()
- if TownsScanConnection then
- TownsScanConnection:Disconnect()
- TownsScanConnection = nil
- end
- end
- WorldTab:CreateToggle({
- Name = "Auto Scan Towns Items (RunService)",
- CurrentValue = false,
- Flag = "TownsScanToggle",
- Callback = function(Value)
- if Value then
- StartTownsScanner()
- Rayfield:Notify({
- Title = "Scanner Active",
- Content = "Continuously scanning towns for items...",
- Duration = 2,
- Image = 4483362458
- })
- else
- StopTownsScanner()
- if TownsAutoBringEnabled then
- TownsAutoBringEnabled = false
- if TownsAutoBringConnection then
- TownsAutoBringConnection:Disconnect()
- TownsAutoBringConnection = nil
- end
- end
- end
- end,
- })
- TownsItemDropdown = WorldTab:CreateDropdown({
- Name = "Select Town Item",
- Options = TownsItemList,
- CurrentOption = {},
- Callback = function(Option) SelectedTownsItem = Option[1] end,
- })
- WorldTab:CreateButton({
- Name = "Bring Selected Item (No Range)",
- Callback = function()
- if SelectedTownsItem then
- BringTownsItemByName(SelectedTownsItem)
- else
- Rayfield:Notify({
- Title = "No Selection",
- Content = "Select an item from the dropdown first.",
- Duration = 2,
- Image = 4483362458
- })
- end
- end
- })
- WorldTab:CreateButton({
- Name = "Bring ALL Town Items (No Range)",
- Callback = BringAllTownsItems
- })
- WorldTab:CreateToggle({
- Name = "Auto Bring Selected Town Item",
- CurrentValue = false,
- Flag = "TownsAutoBringToggle",
- Callback = function(Value)
- TownsAutoBringEnabled = Value
- if Value then
- if not TownsScanConnection then
- StartTownsScanner()
- end
- TownsAutoBringConnection = RunService.Heartbeat:Connect(function()
- if SelectedTownsItem then
- local targetPos = GetBringPosition()
- if targetPos then
- for item, _ in pairs(TownsItems) do
- if item.Name == SelectedTownsItem then
- local root = GetItemRoot(item)
- if root then
- root.CFrame = CFrame.new(targetPos)
- end
- end
- end
- end
- end
- end)
- else
- if TownsAutoBringConnection then
- TownsAutoBringConnection:Disconnect()
- TownsAutoBringConnection = nil
- end
- end
- end,
- })
- -- ==================== VAULT COMBINATION DISPLAY (FIXED - FINDS ALL VAULTS) ====================
- local VaultCombosEnabled = false
- local VaultComboESP = {} -- [key] = BillboardGui
- local VaultComboConnection = nil
- local function ClearVaultESP()
- for _, esp in pairs(VaultComboESP) do
- if esp then esp:Destroy() end
- end
- VaultComboESP = {}
- end
- -- FIXED: Find ALL vaults with a Combination child in the buildings
- -- Searches every building child and every descendant for Vault > Combination
- local function FindAllVaultsInTown(town)
- local foundVaults = {}
- local buildings = town:FindFirstChild("Buildings")
- if not buildings then return foundVaults end
- -- Method 1: Search ALL descendants of Buildings for any object named "Vault" that has a "Combination" child
- -- This catches: BankDestroyed.Vault, Bank.Vault, DestroyedBank.Vault, or even Vault directly under Buildings
- for _, descendant in ipairs(buildings:GetDescendants()) do
- if descendant.Name == "Vault" then
- local combination = descendant:FindFirstChild("Combination")
- if combination then
- -- Get the parent building name for display
- local parentBuilding = descendant.Parent
- local buildingName = parentBuilding and parentBuilding.Name or "Unknown"
- table.insert(foundVaults, {
- Vault = descendant,
- Combination = combination,
- BuildingName = buildingName
- })
- end
- end
- end
- -- Method 2: Also check if any building child itself is named "Combination" (edge case)
- -- Or if buildings have direct children with Combination (like Buildings[22].Vault.Combination)
- for _, child in ipairs(buildings:GetChildren()) do
- -- Check if this child directly has a Vault with Combination
- local vault = child:FindFirstChild("Vault")
- if vault then
- local combination = vault:FindFirstChild("Combination")
- if combination then
- -- Check if already found
- local alreadyFound = false
- for _, v in ipairs(foundVaults) do
- if v.Vault == vault then
- alreadyFound = true
- break
- end
- end
- if not alreadyFound then
- table.insert(foundVaults, {
- Vault = vault,
- Combination = combination,
- BuildingName = child.Name
- })
- end
- end
- end
- end
- return foundVaults
- end
- local function GetCombinationValue(combination)
- -- Try to get the value - could be StringValue, IntValue, NumberValue, Model, Folder, etc.
- if combination:IsA("StringValue") then
- return combination.Value
- elseif combination:IsA("IntValue") or combination:IsA("NumberValue") then
- return tostring(combination.Value)
- elseif combination:IsA("Model") or combination:IsA("Folder") then
- local parts = {}
- for _, child in ipairs(combination:GetChildren()) do
- if child:IsA("ValueBase") then
- table.insert(parts, tostring(child.Value))
- else
- table.insert(parts, child.Name)
- end
- end
- if #parts > 0 then
- return table.concat(parts, " - ")
- end
- return combination.Name
- else
- local ok, val = pcall(function() return combination.Value end)
- if ok and val then return tostring(val) end
- return combination.Name
- end
- end
- local function DisplayVaultCombos()
- local towns = workspace:FindFirstChild("Towns")
- if not towns then return end
- -- Get player position for distance check
- local player = game.Players.LocalPlayer
- local playerChar = player.Character
- local playerPos = nil
- if playerChar and playerChar:FindFirstChild("HumanoidRootPart") then
- playerPos = playerChar.HumanoidRootPart.Position
- end
- local MAX_DISTANCE = 2000 -- Increased range to show all vaults across map
- local activeKeys = {} -- Track which keys are valid this frame
- for _, town in ipairs(towns:GetChildren()) do
- if town:IsA("Folder") or town:IsA("Model") then
- -- FIXED: Get ALL vaults in this town, not just the first bank found
- local allVaults = FindAllVaultsInTown(town)
- for vaultIndex, vaultData in ipairs(allVaults) do
- local combo = GetCombinationValue(vaultData.Combination)
- if not combo then continue end
- local vault = vaultData.Vault
- local buildingName = vaultData.BuildingName
- -- Find adornee and its position for distance check
- local adornee = vault:FindFirstChildWhichIsA("BasePart", true) or vault.PrimaryPart
- if not adornee then
- -- Try parent building
- local parent = vault.Parent
- if parent then
- adornee = parent:FindFirstChildWhichIsA("BasePart", true) or parent.PrimaryPart
- end
- end
- if not adornee then
- adornee = town:FindFirstChildWhichIsA("BasePart", true)
- end
- local adorneePos = nil
- if adornee then
- adorneePos = adornee.Position
- end
- -- Distance check: skip if player is too far
- if playerPos and adorneePos then
- local dist = (playerPos - adorneePos).Magnitude
- if dist > MAX_DISTANCE then
- continue -- Too far, skip this vault
- end
- end
- -- Unique key per vault (supports multiple vaults per town)
- local key = town.Name .. "_" .. buildingName .. "_" .. tostring(vaultIndex) .. "_" .. combo
- activeKeys[key] = true
- -- Only create if it doesn't already exist
- if not VaultComboESP[key] then
- local billboard = Instance.new("BillboardGui")
- billboard.Adornee = adornee
- billboard.Size = UDim2.new(0, 260, 0, 85)
- billboard.StudsOffset = Vector3.new(0, 8, 0)
- billboard.AlwaysOnTop = true
- billboard.Parent = game.CoreGui
- local frame = Instance.new("Frame", billboard)
- frame.Size = UDim2.new(1, 0, 1, 0)
- frame.BackgroundTransparency = 0.5
- frame.BackgroundColor3 = Color3.fromRGB(10, 40, 10)
- frame.BorderSizePixel = 0
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 8)
- corner.Parent = frame
- local stroke = Instance.new("UIStroke")
- stroke.Color = Color3.fromRGB(50, 255, 50)
- stroke.Thickness = 2
- stroke.Transparency = 0.2
- stroke.Parent = frame
- local townLabel = Instance.new("TextLabel", frame)
- townLabel.Size = UDim2.new(1, 0, 0.25, 0)
- townLabel.Position = UDim2.new(0, 0, 0, 0)
- townLabel.BackgroundTransparency = 1
- townLabel.Text = town.Name:upper()
- townLabel.TextColor3 = Color3.fromRGB(100, 255, 100)
- townLabel.TextScaled = true
- townLabel.Font = Enum.Font.SourceSansBold
- local buildingLabel = Instance.new("TextLabel", frame)
- buildingLabel.Size = UDim2.new(1, 0, 0.2, 0)
- buildingLabel.Position = UDim2.new(0, 0, 0.25, 0)
- buildingLabel.BackgroundTransparency = 1
- buildingLabel.Text = "[" .. buildingName .. "]"
- buildingLabel.TextColor3 = Color3.fromRGB(200, 200, 255)
- buildingLabel.TextScaled = true
- buildingLabel.Font = Enum.Font.SourceSansItalic
- local comboLabel = Instance.new("TextLabel", frame)
- comboLabel.Size = UDim2.new(1, 0, 0.55, 0)
- comboLabel.Position = UDim2.new(0, 0, 0.45, 0)
- comboLabel.BackgroundTransparency = 1
- comboLabel.Text = combo
- comboLabel.TextColor3 = Color3.fromRGB(255, 255, 100)
- comboLabel.TextScaled = true
- comboLabel.Font = Enum.Font.Code
- VaultComboESP[key] = billboard
- end
- end
- end
- end
- -- Remove ESP for vaults that are no longer active (out of range or gone)
- for key, billboard in pairs(VaultComboESP) do
- if not activeKeys[key] then
- if billboard then billboard:Destroy() end
- VaultComboESP[key] = nil
- end
- end
- end
- WorldTab:CreateToggle({
- Name = "Show Vault Combinations (All Towns - FIXED)",
- CurrentValue = false,
- Flag = "VaultComboToggle",
- Callback = function(Value)
- VaultCombosEnabled = Value
- if Value then
- ClearVaultESP()
- DisplayVaultCombos()
- VaultComboConnection = RunService.Heartbeat:Connect(function()
- DisplayVaultCombos()
- end)
- Rayfield:Notify({
- Title = "Vault Codes Active",
- Content = "Scanning ALL buildings for vaults with combinations...",
- Duration = 3,
- Image = 4483362458
- })
- else
- if VaultComboConnection then
- VaultComboConnection:Disconnect()
- VaultComboConnection = nil
- end
- ClearVaultESP()
- end
- end,
- })
- WorldTab:CreateButton({
- Name = "Print ALL Vault Combinations",
- Callback = function()
- local towns = workspace:FindFirstChild("Towns")
- if not towns then
- Rayfield:Notify({
- Title = "Error",
- Content = "No Towns found in workspace.",
- Duration = 2,
- Image = 4483362458
- })
- return
- end
- local combos = {}
- for _, town in ipairs(towns:GetChildren()) do
- if town:IsA("Folder") or town:IsA("Model") then
- local allVaults = FindAllVaultsInTown(town)
- for _, vaultData in ipairs(allVaults) do
- local combo = GetCombinationValue(vaultData.Combination)
- if combo then
- table.insert(combos, town.Name .. " [" .. vaultData.BuildingName .. "]: " .. combo)
- end
- end
- end
- end
- if #combos > 0 then
- local msg = table.concat(combos, "\n")
- Rayfield:Notify({
- Title = "All Vault Combinations",
- Content = msg,
- Duration = 15,
- Image = 4483362458
- })
- print("=== ALL VAULT COMBINATIONS ===\n" .. msg)
- else
- Rayfield:Notify({
- Title = "None Found",
- Content = "No vault combinations found in any town.",
- Duration = 3,
- Image = 4483362458
- })
- end
- end
- })
- -- ==================== FULL BRIGHTNESS ====================
- local FullBrightnessEnabled = false
- local OriginalLighting = {}
- local Lighting = game:GetService("Lighting")
- -- Save original lighting values
- local function SaveOriginalLighting()
- OriginalLighting = {
- Brightness = Lighting.Brightness,
- Ambient = Lighting.Ambient,
- OutdoorAmbient = Lighting.OutdoorAmbient,
- FogEnd = Lighting.FogEnd,
- FogStart = Lighting.FogStart,
- TimeOfDay = Lighting.TimeOfDay,
- ClockTime = Lighting.ClockTime,
- GeographicLatitude = Lighting.GeographicLatitude,
- GlobalShadows = Lighting.GlobalShadows,
- Technology = Lighting.Technology,
- ShadowSoftness = Lighting.ShadowSoftness,
- EnvironmentDiffuseScale = Lighting.EnvironmentDiffuseScale,
- EnvironmentSpecularScale = Lighting.EnvironmentSpecularScale,
- ExposureCompensation = Lighting.ExposureCompensation,
- ColorShift_Bottom = Lighting.ColorShift_Bottom,
- ColorShift_Top = Lighting.ColorShift_Top
- }
- end
- -- Apply full brightness settings
- local function ApplyFullBrightness()
- Lighting.Brightness = 3
- Lighting.Ambient = Color3.new(1, 1, 1)
- Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
- Lighting.FogEnd = 100000
- Lighting.FogStart = 100000
- Lighting.ClockTime = 14
- Lighting.GeographicLatitude = 41.733
- Lighting.GlobalShadows = false
- Lighting.ShadowSoftness = 0
- Lighting.EnvironmentDiffuseScale = 1
- Lighting.EnvironmentSpecularScale = 1
- Lighting.ExposureCompensation = 1
- Lighting.ColorShift_Bottom = Color3.new(1, 1, 1)
- Lighting.ColorShift_Top = Color3.new(1, 1, 1)
- -- Also disable shadows on all existing parts
- pcall(function()
- for _, desc in ipairs(workspace:GetDescendants()) do
- if desc:IsA("BasePart") then
- desc.CastShadow = false
- end
- end
- end)
- end
- -- Restore original lighting
- local function RestoreLighting()
- if next(OriginalLighting) == nil then return end
- Lighting.Brightness = OriginalLighting.Brightness
- Lighting.Ambient = OriginalLighting.Ambient
- Lighting.OutdoorAmbient = OriginalLighting.OutdoorAmbient
- Lighting.FogEnd = OriginalLighting.FogEnd
- Lighting.FogStart = OriginalLighting.FogStart
- Lighting.ClockTime = OriginalLighting.ClockTime
- Lighting.GeographicLatitude = OriginalLighting.GeographicLatitude
- Lighting.GlobalShadows = OriginalLighting.GlobalShadows
- Lighting.ShadowSoftness = OriginalLighting.ShadowSoftness
- Lighting.EnvironmentDiffuseScale = OriginalLighting.EnvironmentDiffuseScale
- Lighting.EnvironmentSpecularScale = OriginalLighting.EnvironmentSpecularScale
- Lighting.ExposureCompensation = OriginalLighting.ExposureCompensation
- Lighting.ColorShift_Bottom = OriginalLighting.ColorShift_Bottom
- Lighting.ColorShift_Top = OriginalLighting.ColorShift_Top
- end
- WorldTab:CreateToggle({
- Name = "Full Brightness (No Darkness)",
- CurrentValue = false,
- Flag = "FullBrightnessToggle",
- Callback = function(Value)
- FullBrightnessEnabled = Value
- if Value then
- SaveOriginalLighting()
- ApplyFullBrightness()
- Rayfield:Notify({
- Title = "Full Brightness ON",
- Content = "Lighting maximized, shadows disabled.",
- Duration = 3,
- Image = 4483362458
- })
- else
- RestoreLighting()
- Rayfield:Notify({
- Title = "Full Brightness OFF",
- Content = "Original lighting restored.",
- Duration = 3,
- Image = 4483362458
- })
- end
- end,
- })
- -- Continuously maintain full brightness using RunService Heartbeat (every frame)
- -- This fights the game's darkness by re-applying max brightness EVERY SINGLE FRAME
- FullBrightnessConnection = RunService.Heartbeat:Connect(function()
- if FullBrightnessEnabled then
- Lighting.Brightness = 3
- Lighting.Ambient = Color3.new(1, 1, 1)
- Lighting.OutdoorAmbient = Color3.new(1, 1, 1)
- Lighting.FogEnd = 100000
- Lighting.FogStart = 100000
- Lighting.ClockTime = 14
- Lighting.GlobalShadows = false
- Lighting.ShadowSoftness = 0
- Lighting.ExposureCompensation = 1
- Lighting.EnvironmentDiffuseScale = 1
- Lighting.EnvironmentSpecularScale = 1
- Lighting.ColorShift_Bottom = Color3.new(1, 1, 1)
- Lighting.ColorShift_Top = Color3.new(1, 1, 1)
- end
- end)
- -- ==================== OBJECTMODELS SCANNER (RunService) ====================
- local ObjectModelsScanEnabled = false
- local ObjectModelsScanConnection = nil
- local ObjectModelsItems = {} -- [itemName] = count
- local ObjectModelsAutoBring = {} -- [itemName] = connection
- local LastObjectModelsScan = 0
- local ObjectModelItems = {
- "bandage",
- "snake_oil",
- "gold_bar",
- "silver_bar",
- "bond",
- "coal"
- }
- local function GetObjectModelRoot(obj)
- if obj:IsA("BasePart") then return obj end
- if obj:IsA("Model") then return obj.PrimaryPart or obj:FindFirstChildWhichIsA("BasePart", true) end
- return obj:FindFirstChild("Handle") or obj:FindFirstChildWhichIsA("BasePart", true)
- end
- local function ScanObjectModels()
- local objectModels = workspace:FindFirstChild("ObjectModels")
- if not objectModels then return end
- local found = {}
- for _, item in ipairs(ObjectModelItems) do
- found[item] = 0
- end
- for _, obj in ipairs(objectModels:GetChildren()) do
- local name = obj.Name:lower()
- if found[name] ~= nil then
- found[name] = found[name] + 1
- end
- end
- -- Also check descendants in case items are nested
- for _, obj in ipairs(objectModels:GetDescendants()) do
- local name = obj.Name:lower()
- if found[name] ~= nil then
- found[name] = found[name] + 1
- end
- end
- ObjectModelsItems = found
- end
- local function BringObjectModelItem(itemName)
- local objectModels = workspace:FindFirstChild("ObjectModels")
- if not objectModels then
- Rayfield:Notify({
- Title = "Error",
- Content = "workspace.ObjectModels not found.",
- Duration = 2,
- Image = 4483362458
- })
- return
- end
- local targetPos = GetBringPosition()
- if not targetPos then return end
- local brought = 0
- -- Check direct children first
- for _, obj in ipairs(objectModels:GetChildren()) do
- if obj.Name:lower() == itemName:lower() then
- local root = GetObjectModelRoot(obj)
- if root then
- root.CFrame = CFrame.new(targetPos)
- brought = brought + 1
- end
- end
- end
- -- Also check descendants
- for _, obj in ipairs(objectModels:GetDescendants()) do
- if obj.Name:lower() == itemName:lower() then
- local root = GetObjectModelRoot(obj)
- if root then
- root.CFrame = CFrame.new(targetPos)
- brought = brought + 1
- end
- end
- end
- if brought > 0 then
- Rayfield:Notify({
- Title = "Item Brought",
- Content = "Brought " .. brought .. "x " .. itemName .. " from ObjectModels.",
- Duration = 2,
- Image = 4483362458
- })
- else
- Rayfield:Notify({
- Title = "Not Found",
- Content = itemName .. " not found in ObjectModels.",
- Duration = 2,
- Image = 4483362458
- })
- end
- end
- -- Create buttons for each ObjectModels item
- WorldTab:CreateToggle({
- Name = "Auto Scan ObjectModels (RunService)",
- CurrentValue = false,
- Flag = "ObjectModelsScanToggle",
- Callback = function(Value)
- ObjectModelsScanEnabled = Value
- if Value then
- ObjectModelsScanConnection = RunService.Heartbeat:Connect(function()
- local now = tick()
- if now - LastObjectModelsScan >= 0.3 then
- LastObjectModelsScan = now
- ScanObjectModels()
- end
- end)
- Rayfield:Notify({
- Title = "Scanner Active",
- Content = "RunService scanning ObjectModels for items...",
- Duration = 2,
- Image = 4483362458
- })
- else
- if ObjectModelsScanConnection then
- ObjectModelsScanConnection:Disconnect()
- ObjectModelsScanConnection = nil
- end
- -- Stop all auto brings
- for itemName, conn in pairs(ObjectModelsAutoBring) do
- if conn then conn:Disconnect() end
- end
- ObjectModelsAutoBring = {}
- end
- end,
- })
- -- Individual bring buttons for each item
- WorldTab:CreateButton({
- Name = "Bring Bandage",
- Callback = function() BringObjectModelItem("bandage") end
- })
- WorldTab:CreateButton({
- Name = "Bring Snake Oil",
- Callback = function() BringObjectModelItem("snake_oil") end
- })
- WorldTab:CreateButton({
- Name = "Bring Gold Bar",
- Callback = function() BringObjectModelItem("gold_bar") end
- })
- WorldTab:CreateButton({
- Name = "Bring Silver Bar",
- Callback = function() BringObjectModelItem("silver_bar") end
- })
- WorldTab:CreateButton({
- Name = "Bring Bond",
- Callback = function() BringObjectModelItem("bond") end
- })
- WorldTab:CreateButton({
- Name = "Bring Coal",
- Callback = function() BringObjectModelItem("coal") end
- })
- -- Auto bring toggles for each item
- local function CreateAutoBringToggle(itemName, displayName)
- WorldTab:CreateToggle({
- Name = "Auto Bring " .. displayName,
- CurrentValue = false,
- Flag = "AutoBring" .. itemName,
- Callback = function(Value)
- if Value then
- if not ObjectModelsScanConnection then
- ObjectModelsScanEnabled = true
- ObjectModelsScanConnection = RunService.Heartbeat:Connect(function()
- local now = tick()
- if now - LastObjectModelsScan >= 0.3 then
- LastObjectModelsScan = now
- ScanObjectModels()
- end
- end)
- end
- ObjectModelsAutoBring[itemName] = RunService.Heartbeat:Connect(function()
- local objectModels = workspace:FindFirstChild("ObjectModels")
- if not objectModels then return end
- local targetPos = GetBringPosition()
- if not targetPos then return end
- for _, obj in ipairs(objectModels:GetChildren()) do
- if obj.Name:lower() == itemName then
- local root = GetObjectModelRoot(obj)
- if root then
- root.CFrame = CFrame.new(targetPos)
- end
- end
- end
- for _, obj in ipairs(objectModels:GetDescendants()) do
- if obj.Name:lower() == itemName then
- local root = GetObjectModelRoot(obj)
- if root then
- root.CFrame = CFrame.new(targetPos)
- end
- end
- end
- end)
- else
- if ObjectModelsAutoBring[itemName] then
- ObjectModelsAutoBring[itemName]:Disconnect()
- ObjectModelsAutoBring[itemName] = nil
- end
- end
- end,
- })
- end
- CreateAutoBringToggle("bandage", "Bandage")
- CreateAutoBringToggle("snake_oil", "Snake Oil")
- CreateAutoBringToggle("gold_bar", "Gold Bar")
- CreateAutoBringToggle("silver_bar", "Silver Bar")
- CreateAutoBringToggle("bond", "Bond")
- CreateAutoBringToggle("coal", "Coal")
Advertisement
Add Comment
Please, Sign In to add comment