local Version = "1.6.63"
local WindUI = loadstring(game:HttpGet("https://[Log in to view URL]" .. Version .. "/main.lua"))()

-- Initialize safeguard variables to prevent automatic activation
getgenv().ManualConstructionToggle = true
getgenv().ConstructionManuallyActivated = false

local Window = WindUI:CreateWindow({
    Title = "Scorpio Hub | Vice City 2", 
    Icon = "rbxassetid://81817688420352",
    IconSize = 45,
    Author = "Vice City 2",
    Folder = "MySuperHub",
    
    Size = UDim2.fromOffset(550, 400),
    Transparent = false,
    Theme = "Crimson",
    Resizable = true,
    SideBarWidth = 180,
    BackgroundImageTransparency = 0.6,
    HideSearchBar = false,
    ScrollBarEnabled = true,
    
    Background = "rbxassetid://81817688420352",
    
    User = {
        Enabled = false,
        Anonymous = false,
        Callback = function()
            print("User clicked")
        end,
    },

    Thumbnail = {
        Image = "rbxassetid://81817688420352", 
        Title = "Thumbnail",
    },
})
Window:EditOpenButton({
    Title = "Vice City 2",
    Icon = "rbxassetid://81817688420352",
    CornerRadius = UDim.new(0,16),
    StrokeThickness = 2,
    Color = ColorSequence.new(Color3.fromRGB(13, 105, 172)), -- dark blue
    OnlyMobile = false,
    Enabled = true,
    Draggable = true,
    Position = UDim2.new(0.5, -75, 0, 50), -- Top middle of screen
    Size = UDim2.new(0, 150, 0, 50), -- Button size
})


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

if SenseESPInterface then
    WindUI:Notify({
        Title = "Sense ESP",
        Content = "Loading Sense ESP...\nSense ESP library loaded successfully!\nSense ESP Initialized!",
        Duration = 3,
        Icon = "bird",
    })
    SenseESPInterface.Load()
else
    WindUI:Notify({
        Title = "Error",
        Content = "Failed to load Sense ESP Library.",
        Duration = 3,
        Icon = "bird",
    })
end




local MainTab = Window:Tab({
    Title = "Main",
    Icon = "sun", 
    Locked = false,
})
local VisualsTab = Window:Tab({
    Title = "Visuals",
    Icon = "eye", 
    Locked = false,
})
local FunTab = Window:Tab({
    Title = "Trolls",
    Icon = "shield-ban", 
    Locked = false,
})
local UtilitiesTab = Window:Tab({
    Title = "Player",
    Icon = "circle-ellipsis", 
    Locked = false,
})
Window:SelectTab(1)

Window:SelectTab(1)
local Section = MainTab:Section({ 
    Title = "Teleports",
    TextXAlignment = "Left",
    TextSize = 17, 
})



local player = game.Players.LocalPlayer
local humanoidRootPart
player.CharacterAdded:Connect(function(char)
    humanoidRootPart = char:WaitForChild("HumanoidRootPart", 10)
end)
if player.Character then
    humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
end
local function updateCharacterReferences()
    local character = player.Character or player.CharacterAdded:Wait()
    humanoidRootPart = character:WaitForChild("HumanoidRootPart", 5)
end
updateCharacterReferences()
local locations = {
    ["Dealer ship"] = Vector3.new(-233.35, 5.36, -410.76),
    ["Haircut"] = Vector3.new(-1470.57, 4.81, -68.79),
    ["city pawn"] = Vector3.new(1150.13, 4.84, 647.74),
    ["jewlery"] = Vector3.new(-308.18, 4.81, 653.60),
    ["Real Kicks"] = Vector3.new(169.91, 4.89, 123.23),
    ["Sandwich job"] = Vector3.new(-1484.09, 4.81, -897.24),
    ["gun store"] = Vector3.new(-1258.46, 4.91, -1094.26),
    ["clothing"] = Vector3.new(-1483.40, 4.81, -1763.01),
}
local function teleportToLocation(locVec, locName)
    humanoidRootPart.Parent:FindFirstChild("Humanoid"):ChangeState(0)
    repeat task.wait(0.0001) until not player:GetAttribute("LastACPos")

    humanoidRootPart.CFrame = CFrame.new(locVec)

    task.wait()
    humanoidRootPart.Parent:FindFirstChild("Humanoid"):ChangeState(2)

    WindUI:Notify({
        Title = "Teleported",
        Content = "Teleported to " .. tostring(locName),
        Duration = 2,
        Icon = "bird",
    })
end
local hasPickedLocation = false
local Dropdown = MainTab:Dropdown({
    Title = "Teleport to Location",
    Desc = "Select a location to teleport to",
    Values = (function()
        local vals = {}
        for _, key in ipairs({
            "Dealer ship", "Haircut", "city pawn", "jewlery", "Real Kicks", "Sandwich job",
            "gun store", "clothing",
        }) do
            table.insert(vals, key)
        end
        return vals
    end)(),
    Callback = function(option)
        if not hasPickedLocation then
            hasPickedLocation = true
        end

        if option and locations[option] then
            teleportToLocation(locations[option], option)
        end
    end,
})





local Section = MainTab:Section({ 
    Title = "AutoFarm Teleports",
    TextXAlignment = "Left",
    TextSize = 17, 
})

local function CreateHouseButton(tab, title, x, y, z)
   return tab:Button({
      Title = title,
      Callback = function()
         local player = game.Players.LocalPlayer
         local character = player.Character or player.CharacterAdded:Wait()
         local hrp = character:WaitForChild("HumanoidRootPart")
         hrp.CFrame = CFrame.new(Vector3.new(x, y, z))
      end,
   })
end

-- Brown houses
CreateHouseButton(MainTab, "brown1", -1705, 4.88, -292)
CreateHouseButton(MainTab, "brown2", -1730, 4.88, -291)
CreateHouseButton(MainTab, "brown3", -1751, 4.89, -290)
CreateHouseButton(MainTab, "brown4", -1774, 4.89, -291)

-- Blue houses
CreateHouseButton(MainTab, "blue1", -1703, 4.86, -211)
CreateHouseButton(MainTab, "blue2", -1727, 4.87, -208)
CreateHouseButton(MainTab, "blue3", -1749, 4.86, -210)
CreateHouseButton(MainTab, "blue4", -1774, 4.86, -211)

-- Rob houses
CreateHouseButton(MainTab, "House1", -1661.94031, 5.02908707, -768.745239)
CreateHouseButton(MainTab, "House2", -1546.21106, 4.73244429, -864.211121)
CreateHouseButton(MainTab, "House3", -1248.7749, 4.89688158, -773.067627)
CreateHouseButton(MainTab, "House4", -1913.57117, 4.89688158, -756.265686)




local Section = VisualsTab:Section({ 
    Title = "ESP",
    TextXAlignment = "Left",
    TextSize = 17, 
})

local EnableESP = VisualsTab:Toggle({
    Title = "Enable ESP",
    Desc = "Toggles ESP for enemies and friends",
    Icon = "sun",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if SenseESPInterface then
            SenseESPInterface.teamSettings.enemy.enabled = Value
            SenseESPInterface.teamSettings.friendly.enabled = Value
            if Value then
                WindUI:Notify({
                    Title = "ESP",
                    Content = "Enabled",
                    Duration = 2,
                    Icon = "spotlight",
                })
            end
        else
            WindUI:Notify({
                Title = "ESP Error",
                Content = "Sense ESP not loaded",
                Duration = 2,
                Icon = "spotlight",
            })
        end
    end,
})
local EnableBoxESP = VisualsTab:Toggle({
    Title = "Enable Box ESP",
    Desc = "Draws a box around players",
    Icon = "sun",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if SenseESPInterface then
            SenseESPInterface.teamSettings.enemy.box = Value
            SenseESPInterface.teamSettings.friendly.box = Value
            if Value then
                WindUI:Notify({
                    Title = "Box ESP",
                    Content = "Enabled",
                    Duration = 2,
                    Icon = "spotlight",
                })
            end
        else
            WindUI:Notify({
                Title = "ESP Error",
                Content = "Sense ESP not loaded",
                Duration = 2,
                Icon = "spotlight",
            })
        end
    end,
})
local EnableNameESP = VisualsTab:Toggle({
    Title = "Enable Name ESP",
    Desc = "Shows player names",
    Icon = "sun",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if SenseESPInterface then
            SenseESPInterface.teamSettings.enemy.name = Value
            SenseESPInterface.teamSettings.friendly.name = Value
            if Value then
                WindUI:Notify({
                    Title = "Name ESP",
                    Content = "Enabled",
                    Duration = 2,
                    Icon = "spotlight",
                })
            end
        else
            WindUI:Notify({
                Title = "ESP Error",
                Content = "Sense ESP not loaded",
                Duration = 2,
                Icon = "spotlight",
            })
        end
    end,
})
local EnableHealthESP = VisualsTab:Toggle({
    Title = "Enable Health ESP",
    Desc = "Shows health bars and text",
    Icon = "sun",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if SenseESPInterface then
            SenseESPInterface.teamSettings.enemy.healthBar = Value
            SenseESPInterface.teamSettings.friendly.healthBar = Value
            SenseESPInterface.teamSettings.enemy.healthText = Value
            SenseESPInterface.teamSettings.friendly.healthText = Value
            if Value then
                WindUI:Notify({
                    Title = "Health ESP",
                    Content = "Enabled",
                    Duration = 2,
                    Icon = "spotlight",
                })
            end
        else
            WindUI:Notify({
                Title = "ESP Error",
                Content = "Sense ESP not loaded",
                Duration = 2,
                Icon = "spotlight",
            })
        end
    end,
})
local EnableLineESP = VisualsTab:Toggle({
    Title = "Enable Line ESP",
    Desc = "Draws tracers to players",
    Icon = "sun",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if SenseESPInterface then
            SenseESPInterface.teamSettings.enemy.tracer = Value
            SenseESPInterface.teamSettings.friendly.tracer = Value
            if Value then
                WindUI:Notify({
                    Title = "Line ESP",
                    Content = "Enabled",
                    Duration = 2,
                    Icon = "spotlight",
                })
            end
        else
            WindUI:Notify({
                Title = "ESP Error",
                Content = "Sense ESP not loaded",
                Duration = 2,
                Icon = "spotlight",
            })
        end
    end,
})
local Slider = VisualsTab:Slider({
    Title = "Time of Day",
    Step = 1, 
    Value = {
        Min = 0,
        Max = 24,
        Default = 12,
    },
    Callback = function(value)
 
        local hour = math.floor(value)
        local minutes = math.floor((value - hour) * 60)
        local timeString = string.format("%02d:%02d:00", hour, minutes)


        game.Lighting.TimeOfDay = timeString
    end
})



getgenv().killbring = false

FunTab:Toggle({
    Title = "KillBring All",
    Desc = "Bring all and kill them",
    Icon = "map",
    Type = "Checkbox",
    Default = false,
    Callback = function(toggle)
        getgenv().killbring = toggle

        if toggle then
            task.spawn(function()
                while getgenv().killbring do
                    local speaker = game.Players.LocalPlayer
                    local speakerChar = speaker.Character
                    local speakerRoot = speakerChar and speakerChar:FindFirstChild("HumanoidRootPart")

                    if not speakerRoot then
                        task.wait()
                        continue
                    end

                    local radius = 6
                    local players = game.Players:GetPlayers()
                    local step = (2 * math.pi) / #players
                    local i = 0

                    for _, target in ipairs(players) do
                        if target ~= speaker and target.Character then
                            local targetRoot = target.Character:FindFirstChild("HumanoidRootPart")
                            local humanoid = target.Character:FindFirstChildOfClass("Humanoid")

                            if targetRoot then
                                if humanoid then
                                    humanoid.Sit = false
                                end

                                local angle = i * step
                                local offset = Vector3.new(math.cos(angle) * radius, 1, math.sin(angle) * radius)
                                targetRoot.CFrame = speakerRoot.CFrame + offset

                                i += 1
                            end
                        end
                    end

                    task.wait(0.3)
                end
            end)
        end
    end
})
local Section = FunTab:Section({ 
    Title = "Target",
    TextXAlignment = "Left",
    TextSize = 17,
})

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

local SelectedPlayer = nil


local function getPlayerByName(name)
	for _, p in pairs(Players:GetPlayers()) do
		if p.Name == name then
			return p
		end
	end
	return nil
end


local function updatePlayerList()
	local pl = {"None"}
	for _, p in pairs(Players:GetPlayers()) do
		if p ~= LocalPlayer then
			table.insert(pl, p.Name)
		end
	end
	return pl
end


local playerDropdown = FunTab:Dropdown({
	Title = "Select Player",
	Values = updatePlayerList(),
	Value = "",
	Callback = function(selectedOption)
		local selNameStr
		if type(selectedOption) == "table" then
			selNameStr = selectedOption.Value or selectedOption[1] or tostring(selectedOption)
		else
			selNameStr = tostring(selectedOption)
		end

		if selNameStr ~= "" and selNameStr ~= nil then
			if selNameStr == "None" then
				SelectedPlayer = nil
				WindUI:Notify({
					Title = "Player Selection",
					Content = "No player selected",
					Duration = 2,
					Icon = "x"
				})
			else
				SelectedPlayer = getPlayerByName(selNameStr)
				if SelectedPlayer then
					WindUI:Notify({
						Title = "Player Selected",
						Content = selNameStr .. " selected",
						Duration = 2,
						Icon = "check"
					})
				else
					WindUI:Notify({
						Title = "Error",
						Content = "Player '" .. selNameStr .. "' not found",
						Duration = 2,
						Icon = "message-circle-warning"
					})
				end
			end
		end
	end,
})


if not playerDropdown.Frame and playerDropdown._Container then
	local fixFrame = Instance.new("Frame")
	fixFrame.Size = UDim2.new(1, 0, 1, 0)
	fixFrame.BackgroundTransparency = 1
	fixFrame.Parent = playerDropdown._Container
	playerDropdown.Frame = fixFrame
end


local function refreshDropdownOptions()
	if not playerDropdown then return end

	local newOptions = updatePlayerList()
	local currentSelection = playerDropdown.Value


	playerDropdown:Refresh(newOptions)


	if currentSelection and currentSelection ~= "" then
		for _, name in ipairs(newOptions) do
			if name == currentSelection then
				playerDropdown.Value = currentSelection
				SelectedPlayer = getPlayerByName(currentSelection)
				return
			end
		end
	end


	playerDropdown.Value = ""
	SelectedPlayer = nil
end


Players.PlayerAdded:Connect(refreshDropdownOptions)
Players.PlayerRemoving:Connect(refreshDropdownOptions)



local gotoPlayerToggle
gotoPlayerToggle = FunTab:Toggle({
    Title = "TP to Player",
    Desc = "Teleport to the selected player",
    Icon = "map",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if Value then
            if SelectedPlayer then
                -- Ensure target exists
                local targetChar = SelectedPlayer.Character or SelectedPlayer.CharacterAdded:Wait()
                local targetHRP = targetChar:WaitForChild("HumanoidRootPart")

                local myHRP = humanoidRootPart or LocalPlayer.Character:WaitForChild("HumanoidRootPart")

                -- Teleport
                getgenv().SwimMethod = true
                task.wait(1)
                myHRP.CFrame = targetHRP.CFrame
                getgenv().SwimMethod = false

                WindUI:Notify({
                    Title = "Goto",
                    Content = "Teleported to " .. SelectedPlayer.Name,
                    Duration = 2,
                    Icon = "map"
                })
            end

            -- Reset toggle
            if gotoPlayerToggle then
                gotoPlayerToggle:Set(false)
            end
        end
    end,
})
FunTab:Button({
    Title = "Not Fixed",
    Color = Color3.fromRGB(13, 105, 172),

    Callback = function()
        if not SelectedPlayer
            or not SelectedPlayer.Character
            or not SelectedPlayer.Character:FindFirstChild("Head")
        then
            WindUI:Notify({ Title = "Kill Player", Content = "Invalid target selected", Duration = 2, Icon = "bird" })
            return
        end

        local player = game.Players.LocalPlayer

        local function dmg(target, hpart, damage)
            local tool = player.Character and player.Character:FindFirstChildWhichIsA("Tool")
            if not tool then return end

            game:GetService("ReplicatedStorage").InflictTarget:FireServer(
                tool,
                player,
                target.Character.Humanoid,
                target.Character[hpart],
                damage,
                { 0, 0, false, false, tool.GunScript_Server.IgniteScript, tool.GunScript_Server.IcifyScript, 100, 100 },
                { false, 5, 3 },
                target.Character[hpart],
                { false, { 1930359546 }, 1, 1.5, 1 },
                nil,
                nil,
                true
            )
        end

        local function checkgun()
            local gunTool = nil
            for _, v in pairs(player.Backpack:GetDescendants()) do
                if v:IsA("LocalScript") and v.Name == "GunScript_Local" then
                    gunTool = v.Parent
                    break
                end
            end
            if not gunTool and player.Character then
                for _, v in pairs(player.Character:GetDescendants()) do
                    if v:IsA("LocalScript") and v.Name == "GunScript_Local" then
                        gunTool = v.Parent
                        break
                    end
                end
            end
            if gunTool and gunTool:IsA("Tool") then
                player.Character:WaitForChild("Humanoid"):EquipTool(gunTool)
            end
            return gunTool
        end

        local gun = checkgun()
        if not gun then
            WindUI:Notify({ Title = "Kill Player", Content = "No gun found", Duration = 2, Icon = "bird" })
            return
        end

        local handle = gun:FindFirstChild("Handle")
        local muzzleEffect = gun:FindFirstChild("GunScript_Local") and gun.GunScript_Local:FindFirstChild("MuzzleEffect")
        if handle and muzzleEffect and game.ReplicatedStorage:FindFirstChild("VisualizeMuzzle") then
            game.ReplicatedStorage.VisualizeMuzzle:FireServer(
                handle,
                true,
                { false, 7, Color3.new(1, 1.1098, 0), 15, true, 0.02 },
                muzzleEffect
            )
        end

        task.spawn(function()
            local startTime = os.clock()
            while os.clock() - startTime < 5 do
                if not SelectedPlayer.Character
                    or not SelectedPlayer.Character:FindFirstChild("Humanoid")
                    or SelectedPlayer.Character.Humanoid.Health <= 0
                then
                    break
                end
                dmg(SelectedPlayer, "Head", 1000)
                task.wait(0.1)
            end
        end)

        WindUI:Notify({ Title = "Kill Player", Content = "Attacking " .. SelectedPlayer.Name, Duration = 2, Icon = "bird" })
    end,
}) 

local spectateToggleEnabled = false

local spectateToggle = FunTab:Toggle({
    Title = "Spectate Player",
    Desc = "Spectate the selected player",
    Icon = "circle-plus",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if Value == spectateToggleEnabled then
            return 
        end
        spectateToggleEnabled = Value  

        if Value then

            if SelectedPlayer and SelectedPlayer.Character and SelectedPlayer.Character:FindFirstChild("Humanoid") then
                workspace.CurrentCamera.CameraSubject = SelectedPlayer.Character.Humanoid
                WindUI:Notify({
                    Title = "Spectate",
                    Content = "On: " .. SelectedPlayer.Name,
                    Duration = 2,
                    Icon = "eye"
                })
            else
                WindUI:Notify({
                    Title = "Spectate",
                    Content = "No target selected",
                    Duration = 2,
                    Icon = "alert"
                })
                spectateToggle.Value = false
            end
        else

            if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("Humanoid") then
                workspace.CurrentCamera.CameraSubject = LocalPlayer.Character.Humanoid
            end
            WindUI:Notify({
                Title = "Spectate",
                Content = "Off",
                Duration = 2,
                Icon = "circle-plus"
            })
        end
    end,
})



local killBringActive = false
local bringClone
bringClone = FunTab:Toggle({
    Title = "BringClone",
    Desc = "Bring the selected player near you",
    Icon = "circle-plus",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if Value then
            if not SelectedPlayer then
                WindUI:Notify({ Title = "KB", Content = "No target selected", Duration = 2, Icon = "alert" })
                if bringClone then
                    bringClone:Set(false)
                end
                return
            end
            if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
                WindUI:Notify({ Title = "KB", Content = "Your character not ready", Duration = 2, Icon = "alert" })
                if bringClone then
                    bringClone:Set(false)
                end
                return
            end
        end

        killBringActive = Value
        if killBringActive then
            local targetPlayer = SelectedPlayer
            task.spawn(function()
                while killBringActive do
                    local tCharacter = targetPlayer and targetPlayer.Character
                    local tRoot = tCharacter and tCharacter:FindFirstChild("HumanoidRootPart")
                    local humanoidRootPart = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")

                    if not tRoot or not humanoidRootPart then
                        WindUI:Notify({ Title = "KB", Content = "No target/self", Duration = 2, Icon = "alert" })
                        killBringActive = false
                        if bringClone then
                            bringClone:Set(false)
                        end
                        break
                    end

                    local tHumanoid = tCharacter:FindFirstChildOfClass("Humanoid")
                    if tHumanoid then
                        tHumanoid.Sit = false
                    end

                    task.wait()
                    tRoot.CFrame = humanoidRootPart.CFrame + Vector3.new(3, 1, 0)
                    task.wait(0.1)
                end
            end)
        end
    end,
})


local viewInventory
viewInventory = FunTab:Toggle({
    Title = "View Inventory",
    Desc = "View selected player's backpack items",
    Icon = "circle-plus",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        if Value then
            if SelectedPlayer and SelectedPlayer:FindFirstChild("Backpack") then
                local items = {}
                for _, i in ipairs(SelectedPlayer.Backpack:GetChildren()) do
                    table.insert(items, i.Name)
                end
                WindUI:Notify({
                    Title = SelectedPlayer.Name .. "'s Inv",
                    Content = (#items > 0 and table.concat(items, ", ") or "Empty"),
                    Duration = 5,
                    Icon = "circle-plus"
                })
            else
                WindUI:Notify({ Title = "Inv", Content = "No target/backpack", Duration = 2, Icon = "alert" })
            end
            if viewInventory then
                viewInventory:Set(false)
            end
        end
    end,
})



local Section = UtilitiesTab:Section({ 
    Title = "Player",
    TextXAlignment = "Left",
    TextSize = 17, 
})

                local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")

local player = Players.LocalPlayer
local camera = Workspace.CurrentCamera

-- CONFIG DEFAULTS
Config = Config or {}
Config.FlyEnabled = Config.FlyEnabled or false
Config.FlySpeed = Config.FlySpeed or 5

local flyEnabled = false
local swimMethod = false
local speedConnection = nil
local CFloop = nil

local function handleSpeed()
    if not swimMethod then return end
    
    local character = player.Character
    if not character or not character.Parent then return end
    
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    local hrp = character:FindFirstChild("HumanoidRootPart")
    if not humanoid or not hrp or humanoid.Health <= 0 then return end
    
    humanoid:ChangeState(0)

    if flyEnabled then
        hrp.RotVelocity = Vector3.new(0, 0, 0)
        return
    end
    
    local moveDir = humanoid.MoveDirection
    if moveDir.Magnitude > 0 then
        local worldMoveVec = Vector3.new(moveDir.X, 0, moveDir.Z).Unit * (50 * 16)
        if worldMoveVec.Magnitude == worldMoveVec.Magnitude then 
            hrp.Velocity = Vector3.new(worldMoveVec.X, hrp.Velocity.Y, worldMoveVec.Z)
        end
    else
        hrp.Velocity = Vector3.new(0, hrp.Velocity.Y, 0)
    end
    
    hrp.RotVelocity = Vector3.new(0, 0, 0)
end

local function onCharacterAdded(char)
    if speedConnection then
        speedConnection:Disconnect()
        speedConnection = nil
    end
    
    local success = pcall(function()
        char:WaitForChild("Humanoid", 5)
        char:WaitForChild("HumanoidRootPart", 5)
    end)
    
    if not success then return end
    
    speedConnection = RunService.Stepped:Connect(function()
        local success = pcall(handleSpeed)
        if not success and speedConnection then
            speedConnection:Disconnect()
            speedConnection = nil
        end
    end)
end

if player.Character then
    onCharacterAdded(player.Character)
end
player.CharacterAdded:Connect(onCharacterAdded)

local function StartFly()
    if flyEnabled then return end
    flyEnabled = true
    swimMethod = true

    task.wait(0.2)
    
    local character = player.Character or player.CharacterAdded:Wait()
    if not character then return end

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    local head = character:FindFirstChild("Head")
    if not humanoid or not head then return end

    humanoid.PlatformStand = true
    head.Anchored = true

    if CFloop then 
        CFloop:Disconnect() 
    end

    CFloop = RunService.Heartbeat:Connect(function(deltaTime)
        if not flyEnabled or not character or not character.Parent then
            if CFloop then CFloop:Disconnect() end
            return
        end
        
        local moveDir = humanoid.MoveDirection
        local speed = (Config.FlySpeed or 5) * deltaTime * 100
        
        local camCF = camera.CFrame
        local _, yRot, _ = camCF:ToOrientation()
        local uprightRot = CFrame.Angles(0, yRot, 0)

        local flatCamCF = CFrame.new(camCF.Position) * uprightRot
        local localInput = flatCamCF:VectorToObjectSpace(moveDir * speed)
        local worldMovement = camCF:VectorToWorldSpace(localInput)

        head.CFrame = CFrame.new(head.Position + worldMovement) * uprightRot
        camera.CameraSubject = head
    end)
end

local function StopFly()
    if not flyEnabled then return end
    flyEnabled = false
    swimMethod = false

    if CFloop then
        CFloop:Disconnect()
        CFloop = nil
    end
    
    local character = player.Character
    if character then
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        local head = character:FindFirstChild("Head")
        
        if humanoid then
            humanoid.PlatformStand = false
            humanoid:ChangeState(Enum.HumanoidStateType.Running)
        end
        
        if head then
            head.Anchored = false
        end
    end
end

-- TOGGLE
UtilitiesTab:Toggle({
    Title = "Enable Fly",
    Desc = "enable flying",
    Icon = "map",
    Type = "Checkbox",
    Callback = function(state)
        Config.FlyEnabled = state

        if state then
            StartFly()
        else
            StopFly()
        end
    end
})

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local speed = 16
local boostMultiplier = 2
local enhancedWalk = false
local character, humanoid, humanoidRootPart
local bodyGyro
local movementConnection
local freezeConnection
local animationTrack
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://88126442676104" 
getgenv().SwimMethod = false
task.spawn(function()
	while task.wait() do
		
		if enhancedWalk then
			if not getgenv().SwimMethod then
				getgenv().SwimMethod = true
			end
			if humanoid then
				humanoid:ChangeState(Enum.HumanoidStateType.FallingDown)
			end
		end
	end
end)
local function updateCharacterRefs()
	character = player.Character or player.CharacterAdded:Wait()
	humanoidRootPart = character:WaitForChild("HumanoidRootPart")
	humanoid = character:WaitForChild("Humanoid")
end
local function cleanup()
	if movementConnection then movementConnection:Disconnect() movementConnection = nil end
	if freezeConnection then freezeConnection:Disconnect() freezeConnection = nil end
	if bodyGyro then bodyGyro:Destroy() bodyGyro = nil end
	if animationTrack then animationTrack:Stop() animationTrack = nil end
end
local function setupMovement()
	bodyGyro = Instance.new("BodyGyro")
	bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
	bodyGyro.P = 50000
	bodyGyro.D = 1000
	bodyGyro.CFrame = humanoidRootPart.CFrame
	bodyGyro.Parent = humanoidRootPart

	movementConnection = RunService.RenderStepped:Connect(function()
		if not enhancedWalk then return end

		local camera = workspace.CurrentCamera
		local dir = Vector3.zero
		local usingKeys = false

		if UserInputService:IsKeyDown(Enum.KeyCode.W) then
			dir += Vector3.new(camera.CFrame.LookVector.X, 0, camera.CFrame.LookVector.Z)
			usingKeys = true
		end
		if UserInputService:IsKeyDown(Enum.KeyCode.S) then
			dir -= Vector3.new(camera.CFrame.LookVector.X, 0, camera.CFrame.LookVector.Z)
			usingKeys = true
		end
		if UserInputService:IsKeyDown(Enum.KeyCode.A) then
			dir -= camera.CFrame.RightVector
			usingKeys = true
		end
		if UserInputService:IsKeyDown(Enum.KeyCode.D) then
			dir += camera.CFrame.RightVector
			usingKeys = true
		end

		if not usingKeys then
			local md = humanoid.MoveDirection
			dir = Vector3.new(md.X, 0, md.Z)
		end

		local moveSpeed = speed
		if UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) then
			moveSpeed = moveSpeed * boostMultiplier
		end

		if dir.Magnitude > 0 then
			dir = dir.Unit * moveSpeed
		end

		local currentY = humanoidRootPart.AssemblyLinearVelocity.Y
		local groundedY = math.clamp(currentY, -100, -2)
		humanoidRootPart.AssemblyLinearVelocity = Vector3.new(dir.X, groundedY, dir.Z)

		if dir.Magnitude > 0 then
			local look = dir.Unit
			bodyGyro.CFrame = CFrame.new(humanoidRootPart.Position, humanoidRootPart.Position + Vector3.new(look.X, 0, look.Z))
		end

		humanoidRootPart.RotVelocity = Vector3.zero
		humanoidRootPart.AssemblyAngularVelocity = Vector3.zero

		if dir.Magnitude > 0 then
			if not animationTrack.IsPlaying then animationTrack:Play() end
		else
			if animationTrack.IsPlaying then animationTrack:Stop() end
		end
	end)
end
local function startEnhancedWalk()
	enhancedWalk = true
	updateCharacterRefs()
	cleanup()
	humanoidRootPart.AssemblyLinearVelocity = Vector3.zero
	getgenv().SwimMethod = true
	freezeConnection = RunService.RenderStepped:Connect(function()
		if enhancedWalk then
			
			if not getgenv().SwimMethod then
				getgenv().SwimMethod = true
			end
			humanoidRootPart.AssemblyLinearVelocity = Vector3.zero
		end
	end)
	local animator = humanoid:FindFirstChildWhichIsA("Animator") or Instance.new("Animator", humanoid)
	animationTrack = animator:LoadAnimation(animation)
	animationTrack.Looped = true

	task.delay(3, function()
		if freezeConnection then freezeConnection:Disconnect() freezeConnection = nil end
		if enhancedWalk then
			setupMovement()
		end
	end)
end
local function stopEnhancedWalk()
	enhancedWalk = false
	cleanup()
	getgenv().SwimMethod = false
end
player.CharacterAdded:Connect(function()
	task.wait(1)
	updateCharacterRefs()
	if enhancedWalk then
		startEnhancedWalk()
	end
end)
local Toggle = UtilitiesTab:Toggle({
    Title = "Enable WalkSpeed",
    Desc = "Toggle enhanced walk mode",
    Icon = "footprints",
    Type = "Checkbox",
    Default = false,
    Callback = function(state) 
        if state then
            startEnhancedWalk()
        else
            stopEnhancedWalk()
        end
    end
})
local Slider = UtilitiesTab:Slider({
    Title = "‍Change Walk Speed",
    Step = 1,
    Value = {
        Min = 16,
        Max = 200,
        Default = speed,
    },
    Callback = function(value)
        speed = value
    end
})



local Section = UtilitiesTab:Section({ 
    Title = "Players",
    TextXAlignment = "Left",
    TextSize = 17, 
})

local noClipEnabled = false

local function toggleNoClip(state)
    noClipEnabled = state
end

RunService.Stepped:Connect(function()
    if noClipEnabled and LocalPlayer.Character then
        for _, part in ipairs(LocalPlayer.Character:GetDescendants()) do
            if part:IsA("BasePart") then
                part.CanCollide = false
            end
        end
    end
end)

UtilitiesTab:Toggle({
    Title = "No-Clip",
    Desc = "Walk through walls",
    Icon = "feather",
    Type = "Checkbox",
    Callback = function(Value)
        toggleNoClip(Value)
    end
})

local energy = UtilitiesTab:Toggle({
    Title = "Infinite Energy",
    Desc = "Energy at Full bar",
    Icon = "feather",
    Type = "Checkbox",
    Default = false,
    Callback = function(state)
        if state then
            -- Start infinite energy
            _G.InfiniteEnergy = true
            spawn(function()
                local player = game:GetService("Players").LocalPlayer
                local hud = player:WaitForChild("PlayerGui"):WaitForChild("HUD", 5)
                if not hud then return end
                
                local status = hud:WaitForChild("Status", 5)
                local energy = status:WaitForChild("Energy", 5)
                
                while _G.InfiniteEnergy do
                    pcall(function()
                        local bar = energy:FindFirstChild("Bar") or energy
                        if bar:IsA("Frame") then
                            bar.Size = UDim2.new(1, 0, 1, 0)
                        elseif bar:IsA("NumberValue") or bar:IsA("IntValue") then
                            bar.Value = 999999
                        end
                    end)
                    task.wait(0.05)
                end
            end)
        else
            -- Turn off
            _G.InfiniteEnergy = false
        end
    end
})

UtilitiesTab:Toggle({
    Title = "Instant Interact",
    Desc = "Player",
    Icon = "feather",
    Type = "Checkbox",
    Default = false,
    Callback = function(Value)
        local Workspace = game:GetService("Workspace")
        local function updateProximityPrompts()
            for i, v in ipairs(Workspace:GetDescendants()) do
                if v.ClassName == "ProximityPrompt" then
                    v.HoldDuration = Value and 0 or 1
                end
            end
        end
        updateProximityPrompts()
        Workspace.DescendantAdded:Connect(function(descendant)
            if descendant.ClassName == "ProximityPrompt" then
                descendant.HoldDuration = Value and 0 or 1
            end
        end)
    end,
})
UtilitiesTab:Button({
    Title = " Open FreeCam UI",
    Desc = "Open FreeCam interface",
    Color = Color3.fromRGB(13, 105, 172),
    Justify = "Center",
    IconAlign = "Left",
    Icon = "camera",
    Locked = false,
    Callback = function()
        -- FreeCam with Draggable Top Button

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local char = player.Character or player.CharacterAdded:Wait()
local root = char:WaitForChild("HumanoidRootPart")

local enabled = false
local speed = 2
local sensitivity = 0.25
local rotX = 0
local rotY = 0

-- GUI
local gui = Instance.new("ScreenGui")
gui.Parent = player:WaitForChild("PlayerGui")

local open = Instance.new("TextButton")
open.Parent = gui
open.Size = UDim2.new(0,180,0,40)
open.Position = UDim2.new(0.5,-90,0,10)
open.Text = "FreeCam"
open.BackgroundColor3 = Color3.fromRGB(0,0,0)
open.TextColor3 = Color3.fromRGB(13, 105, 172)

Instance.new("UICorner", open)

-- MAKE DRAGGABLE
open.Active = true
open.Draggable = true

-- Disable function
local function disableFreecam()
    enabled = false
    camera.CameraType = Enum.CameraType.Custom
    UIS.MouseBehavior = Enum.MouseBehavior.Default
    root.Anchored = false
end

-- Toggle
open.MouseButton1Click:Connect(function()

    if enabled then
        disableFreecam()
    else
        enabled = true
        camera.CameraType = Enum.CameraType.Scriptable
        UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
        root.Anchored = true
    end

end)

-- Right Shift disable
UIS.InputBegan:Connect(function(input, gpe)
    if gpe then return end
    
    if input.KeyCode == Enum.KeyCode.RightShift then
        disableFreecam()
    end
end)

-- Mouse look
UIS.InputChanged:Connect(function(input)

    if enabled and input.UserInputType == Enum.UserInputType.MouseMovement then
        rotX -= input.Delta.Y * sensitivity
        rotY -= input.Delta.X * sensitivity
    end

end)

-- Movement
RunService.RenderStepped:Connect(function()

    if not enabled then return end

    local camCF =
        CFrame.new(camera.CFrame.Position)
        * CFrame.Angles(0, math.rad(rotY), 0)
        * CFrame.Angles(math.rad(rotX), 0, 0)

    local move = Vector3.zero

    if UIS:IsKeyDown(Enum.KeyCode.W) then move += camCF.LookVector end
    if UIS:IsKeyDown(Enum.KeyCode.S) then move -= camCF.LookVector end
    if UIS:IsKeyDown(Enum.KeyCode.A) then move -= camCF.RightVector end
    if UIS:IsKeyDown(Enum.KeyCode.D) then move += camCF.RightVector end
    if UIS:IsKeyDown(Enum.KeyCode.E) then move += Vector3.new(0,1,0) end
    if UIS:IsKeyDown(Enum.KeyCode.Q) then move -= Vector3.new(0,1,0) end

    camera.CFrame = camCF + move * speed

end)
        WindUI:Notify({
            Title = "FreeCam",
            Content = "FreeCam UI opened",
            Duration = 2,
            Icon = "camera",
        })
    end
})

local player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera
local collecting = false
local function StealMoneyPrompt()
    for _, v in pairs(workspace.Dollas:GetDescendants()) do
        if v:IsA("ProximityPrompt") and v.Name == "ProximityPrompt" then
            v.HoldDuration = 0
            v.RequiresLineOfSight = false
        end
    end
end
local function fireproximityprompt(prompt)
    if prompt and prompt:IsA("ProximityPrompt") then
        prompt:InputHoldBegin()
        task.wait(prompt.HoldDuration or 0)
        prompt:InputHoldEnd()
    end
end
local function collectAndReturn()
    if collecting then return end
    collecting = true

    local char = player.Character
    local hrp = char and char:FindFirstChild("HumanoidRootPart")
    if not hrp then collecting = false return end

    local originalCFrame = hrp.CFrame

    StealMoneyPrompt()

    task.spawn(function()
        local foundAny = false

        for _, v in pairs(workspace.Dollas:GetDescendants()) do
            if v:IsA("ProximityPrompt") and v.Name == "ProximityPrompt" then
                foundAny = true
                StealMoneyPrompt()

                Camera.CFrame = CFrame.new(Camera.CFrame.Position, v.Parent.CFrame.Position)

                local humanoid = char and char:FindFirstChildOfClass("Humanoid")
                if humanoid and hrp then
                    humanoid:ChangeState(0)
                    repeat task.wait() until not player:GetAttribute("LastACPos")
                    hrp.CFrame = v.Parent.CFrame
                end

                task.wait(0.25)
                fireproximityprompt(v)
                task.wait(0.25)
            end
        end

        if not foundAny then
            pcall(function()
                WindUI:Notify({
                    Title = "Pickup Dropped Bread",
                    Content = "No Dropped Money Has Been found!",
                    Duration = 4,
                    Icon = "rocket", 
                })
            end)
        end
        task.wait(0.5)
        if hrp then
            hrp.CFrame = originalCFrame
        end

        collecting = false
    end)
end
local Button = AutoFarmTab:Button({
    Title = "Collect Dropped Cash",
    Desc = "",
    Color = Color3.fromRGB(13, 105, 172),

    Locked = false,
    Callback = function()
        collectAndReturn()
    end
})

-- Function to handle the Admin Tag (Discord Link)
local function ApplyAdminTag(character)
if not character then return end
local head = character:WaitForChild("Head", 5)
if not head then return end

-- Check if tag already exists to prevent duplication
if head:FindFirstChild("AdminTag") then head.AdminTag:Destroy() end

local billboard = Instance.new("BillboardGui")
billboard.Name = "AdminTag"
billboard.AlwaysOnTop = true
billboard.Size = UDim2.new(0, 150, 0, 50)
billboard.StudsOffset = Vector3.new(0, 2.5, 0) -- Adjusted height slightly
billboard.Parent = head

local textLabel = Instance.new("TextLabel")
textLabel.Name = "AdminText"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.Text = "discord.gg/CharlieServices"

-- Changed to Light Blue
textLabel.TextColor3 = Color3.fromRGB(0, 255, 0)

textLabel.TextScaled = true
textLabel.Font = Enum.Font.SourceSansBold
textLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
textLabel.TextStrokeTransparency = 0
textLabel.Parent = billboard
end

-- Run tag function on spawn and respawn
player.CharacterAdded:Connect(ApplyAdminTag)
if player.Character then
    ApplyAdminTag(player.Character)
end

-- Example Tab (You need at least one tab for the UI to be useful!)
local MainTab = Window:CreateTab({
    Title = "Main",
    Icon = "home",
})

MainTab:AddButton({
    Title = "Print Status",
    Callback = function()
        print("Script is running smoothly.")
    end
})

Embed on website

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