local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
   Name = "Anime Champions Simulator",
   LoadingTitle = "Raiden Hub",
   LoadingSubtitle = "by @playthecarti",
   ConfigurationSaving = {
      Enabled = true,
      FolderName = nil, -- Create a custom folder for your hub/game
      FileName = "Big Hub"
   },
   Discord = {
      Enabled = true,
      Invite = "McD3KVePAp", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
      RememberJoins = true -- Set this to false to make them join the discord every time they load it up
   },
   KeySystem = true, -- Set this to true to use our key system
   KeySettings = {
      Title = "Raiden Hub Key",
      Subtitle = "Link in Discord Server",
      Note = "discord.gg/McD3KVePAp",
      FileName = "Raiden Hub Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
      SaveKey = false, -- The user's key will be saved, but if you change the key, they will be unable to use your script
      GrabKeyFromSite = true, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
      Key = {"https://[Log in to view URL]"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
   }
})

local MainTab = Window:CreateTab("🎃Halloween🎃", nil) -- Title, Image
local MainSection = MainTab:CreateSection("Farm")

-- Assuming you have the toggle creation code like before
local Toggle = MainTab:CreateToggle({
   Name = "Candy farm",
   CurrentValue = false, -- Initial state (you can set it to true if you want the script to start active)
   Flag = "ScriptToggle",
   Callback = function(Value)
       -- The function that takes place when the toggle is pressed
       -- The variable (Value) is a boolean on whether the toggle is true or false
       if Value then
           -- If the toggle is turned on, start the script
           spawn(mainLoop)
           print("Script is now active")
       else
           -- If the toggle is turned off, stop the script
           print("Script is now inactive")
       end
   end,
})

local function mainLoop()
    while true do
        wait(15)
        
        local ReplicatedStorage = game:GetService("ReplicatedStorage")
        local UnloadedWorlds = ReplicatedStorage:FindFirstChild("UnloadedWorlds")
        
        if UnloadedWorlds and UnloadedWorlds:FindFirstChild("ShadowWorld") then
            game:GetService("ReplicatedStorage"):WaitForChild("Remote"):WaitForChild("Player"):WaitForChild("Teleport"):FireServer("ShadowWorld")
            wait(5)
        else
            break
        end
    end
    
    local Workspace = game.Workspace
    local jogador = game.Players.LocalPlayer
    local spawnersPath = Workspace:WaitForChild("Worlds"):WaitForChild("ShadowWorld"):WaitForChild("ShadowWorldModel"):WaitForChild("EnemySpawners")
    
    local destinos = {"Shadow_Nomu", "Shadow_Rui", "Shadow_Orochimaru", "AxeHand", "Shadow_Dio", "Shadow_Frieza", "Shadow_Machine3", "Shadow_Mahito", "Shadow_ByakuyaWorld", "Shadow_Katana", "Shadow_ArmourTitan"}
    
    for _, nomeDestino in ipairs(destinos) do
        local destino = spawnersPath:FindFirstChild(nomeDestino)
        if destino and jogador.Character and jogador.Character:FindFirstChild("HumanoidRootPart") then
            jogador.Character.HumanoidRootPart.CFrame = CFrame.new(destino.Position + Vector3.new(0, 5, 0))
            wait(5)
            local newPosition = jogador.Character:FindFirstChild("HumanoidRootPart") and jogador.Character.HumanoidRootPart.Position
            if newPosition and newPosition ~= jogador.LastPosition then
                jogador.LastPosition = newPosition
                break
            end
        end
    end
    
    while true do
        wait(10)
        
        local UnloadedWorlds = game:GetService("ReplicatedStorage"):FindFirstChild("UnloadedWorlds")
        if UnloadedWorlds and UnloadedWorlds:FindFirstChild("ShadowWorld") then
            mainLoop()
        end
    end
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: