Klin V1.5
Key RequiredUniversal

Klin V1.5

Universal ScriptSplixSplix 470 views 92 executesUpdated Jan 4, 2026
Unrated
00
Lua Script•2716 lines (92264 chars)
-- Klin V1.5 Menu Script
local CoreGui = game:GetService("CoreGui")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local localPlayer = Players.LocalPlayer

local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "KlinMenu"
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0, 300, 0, 200)
MainFrame.Position = UDim2.new(0.5, -150, 0.2, -100)
MainFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
MainFrame.BackgroundTransparency = 0.2
MainFrame.BorderSizePixel = 2
MainFrame.Active = true
MainFrame.Draggable = true

local borderRedColors = {
    Color3.fromRGB(80, 0, 0),
    Color3.fromRGB(120, 0, 0),
    Color3.fromRGB(160, 0, 0),
    Color3.fromRGB(200, 0, 0),
    Color3.fromRGB(160, 0, 0),
    Color3.fromRGB(120, 0, 0)
}
local currentBorderColor = 2
local borderAnimationSpeed = 0.08
local lastColorChange = tick()

local function updateBorderColor()
    if tick() - lastColorChange >= borderAnimationSpeed then
        MainFrame.BorderColor3 = borderRedColors[currentBorderColor]
        currentBorderColor = currentBorderColor + 1
        if currentBorderColor > #borderRedColors then
            currentBorderColor = 1
        end
        lastColorChange = tick()
    end
end

local TitleBar = Instance.new("Frame")
TitleBar.Size = UDim2.new(1, 0, 0, 25)
TitleBar.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
TitleBar.BorderSizePixel = 0

local TitleLabel = Instance.new("TextLabel")
TitleLabel.Size = UDim2.new(0, 100, 1, 0)
TitleLabel.Position = UDim2.new(0, 5, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.Text = "Klin V1.5"
TitleLabel.TextColor3 = Color3.fromRGB(255, 50, 50)
TitleLabel.Font = Enum.Font.Code
TitleLabel.TextSize = 14
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left

local MinimizeButton = Instance.new("TextButton")
MinimizeButton.Size = UDim2.new(0, 40, 0, 20)
MinimizeButton.Position = UDim2.new(1, -45, 0, 2)
MinimizeButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
MinimizeButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
MinimizeButton.Text = "-"
MinimizeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
MinimizeButton.Font = Enum.Font.Code
MinimizeButton.TextSize = 14

local PagesContainer = Instance.new("ScrollingFrame")
PagesContainer.Size = UDim2.new(1, -10, 1, -60)
PagesContainer.Position = UDim2.new(0, 5, 0, 55)
PagesContainer.BackgroundTransparency = 1
PagesContainer.ScrollBarThickness = 5
PagesContainer.ScrollBarImageColor3 = Color3.fromRGB(255, 50, 50)
PagesContainer.CanvasSize = UDim2.new(0, 0, 0, 500)
PagesContainer.ClipsDescendants = true

local NavBar = Instance.new("Frame")
NavBar.Size = UDim2.new(1, -10, 0, 25)
NavBar.Position = UDim2.new(0, 5, 0, 30)
NavBar.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
NavBar.BorderColor3 = Color3.fromRGB(100, 0, 0)

local PrevButton = Instance.new("TextButton")
PrevButton.Size = UDim2.new(0, 40, 1, 0)
PrevButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
PrevButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
PrevButton.Text = "<"
PrevButton.TextColor3 = Color3.fromRGB(255, 100, 100)
PrevButton.Font = Enum.Font.Code
PrevButton.TextSize = 14

local PageLabel = Instance.new("TextLabel")
PageLabel.Size = UDim2.new(0, 120, 1, 0)
PageLabel.Position = UDim2.new(0.5, -60, 0, 0)
PageLabel.BackgroundTransparency = 1
PageLabel.Text = "Main"
PageLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
PageLabel.Font = Enum.Font.Code
PageLabel.TextSize = 12

local NextButton = Instance.new("TextButton")
NextButton.Size = UDim2.new(0, 40, 1, 0)
NextButton.Position = UDim2.new(1, -40, 0, 0)
NextButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
NextButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
NextButton.Text = ">"
NextButton.TextColor3 = Color3.fromRGB(255, 100, 100)
NextButton.Font = Enum.Font.Code
NextButton.TextSize = 14

local DeleteButton = Instance.new("TextButton")
DeleteButton.Size = UDim2.new(0, 40, 0, 20)
DeleteButton.Position = UDim2.new(1, -93, 0, 2)
DeleteButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
DeleteButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
DeleteButton.Text = "×"
DeleteButton.TextColor3 = Color3.fromRGB(255, 100, 100)
DeleteButton.Font = Enum.Font.Code
DeleteButton.TextSize = 14

local Pages = {
    Main = Instance.new("Frame"),
    Settings = Instance.new("Frame"),
    Credits = Instance.new("Frame")
}

for pageName, pageFrame in pairs(Pages) do
    pageFrame.Size = UDim2.new(1, 0, 1, 0)
    pageFrame.Position = UDim2.new(0, 0, 0, 0)
    pageFrame.BackgroundTransparency = 1
    pageFrame.Visible = false
    pageFrame.Parent = PagesContainer
end

local UniversalButton = Instance.new("TextButton")
UniversalButton.Size = UDim2.new(1, -20, 0, 25)
UniversalButton.Position = UDim2.new(0, 10, 0, 10)
UniversalButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
UniversalButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
UniversalButton.Text = "Universal"
UniversalButton.TextColor3 = Color3.fromRGB(255, 100, 100)
UniversalButton.Font = Enum.Font.Code
UniversalButton.TextSize = 10
UniversalButton.Parent = Pages.Main

local PrisonLifeButton = Instance.new("TextButton")
PrisonLifeButton.Size = UDim2.new(1, -20, 0, 25)
PrisonLifeButton.Position = UDim2.new(0, 10, 0, 40)
PrisonLifeButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
PrisonLifeButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
PrisonLifeButton.Text = "Prison Life"
PrisonLifeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
PrisonLifeButton.Font = Enum.Font.Code
PrisonLifeButton.TextSize = 10
PrisonLifeButton.Parent = Pages.Main

local SpecterButton = Instance.new("TextButton")
SpecterButton.Size = UDim2.new(1, -20, 0, 25)
SpecterButton.Position = UDim2.new(0, 10, 0, 70)
SpecterButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
SpecterButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
SpecterButton.Text = "Specter"
SpecterButton.TextColor3 = Color3.fromRGB(255, 100, 100)
SpecterButton.Font = Enum.Font.Code
SpecterButton.TextSize = 10
SpecterButton.Parent = Pages.Main

local HorrorMansionButton = Instance.new("TextButton")
HorrorMansionButton.Size = UDim2.new(1, -20, 0, 25)
HorrorMansionButton.Position = UDim2.new(0, 10, 0, 100)
HorrorMansionButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
HorrorMansionButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
HorrorMansionButton.Text = "The Horror Mansion"
HorrorMansionButton.TextColor3 = Color3.fromRGB(255, 100, 100)
HorrorMansionButton.Font = Enum.Font.Code
HorrorMansionButton.TextSize = 10
HorrorMansionButton.Parent = Pages.Main

local UniversalFrame = Instance.new("Frame")
UniversalFrame.Size = UDim2.new(1, 0, 1, 0)
UniversalFrame.Position = UDim2.new(0, 0, 0, 0)
UniversalFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
UniversalFrame.BackgroundTransparency = 0.2
UniversalFrame.BorderColor3 = Color3.fromRGB(150, 0, 0)
UniversalFrame.Visible = false
UniversalFrame.Parent = Pages.Main

local UniversalScroll = Instance.new("ScrollingFrame")
UniversalScroll.Size = UDim2.new(1, -10, 1, -10)
UniversalScroll.Position = UDim2.new(0, 5, 0, 5)
UniversalScroll.BackgroundTransparency = 1
UniversalScroll.ScrollBarThickness = 5
UniversalScroll.ScrollBarImageColor3 = Color3.fromRGB(255, 50, 50)
UniversalScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
UniversalScroll.Parent = UniversalFrame

local UniversalBackButton = Instance.new("TextButton")
UniversalBackButton.Size = UDim2.new(1, -20, 0, 25)
UniversalBackButton.Position = UDim2.new(0, 10, 0, 10)
UniversalBackButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
UniversalBackButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
UniversalBackButton.Text = "Back"
UniversalBackButton.TextColor3 = Color3.fromRGB(255, 100, 100)
UniversalBackButton.Font = Enum.Font.Code
UniversalBackButton.TextSize = 10
UniversalBackButton.Parent = UniversalScroll

local NoclipButton = Instance.new("TextButton")
NoclipButton.Size = UDim2.new(1, -20, 0, 25)
NoclipButton.Position = UDim2.new(0, 10, 0, 40)
NoclipButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
NoclipButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
NoclipButton.Text = "Noclip"
NoclipButton.TextColor3 = Color3.fromRGB(255, 100, 100)
NoclipButton.Font = Enum.Font.Code
NoclipButton.TextSize = 10
NoclipButton.Parent = UniversalScroll

local EspButton = Instance.new("TextButton")
EspButton.Size = UDim2.new(1, -20, 0, 25)
EspButton.Position = UDim2.new(0, 10, 0, 70)
EspButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
EspButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
EspButton.Text = "Esp"
EspButton.TextColor3 = Color3.fromRGB(255, 100, 100)
EspButton.Font = Enum.Font.Code
EspButton.TextSize = 10
EspButton.Parent = UniversalScroll

local FlyButton = Instance.new("TextButton")
FlyButton.Size = UDim2.new(1, -20, 0, 25)
FlyButton.Position = UDim2.new(0, 10, 0, 100)
FlyButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
FlyButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
FlyButton.Text = "Fly"
FlyButton.TextColor3 = Color3.fromRGB(255, 100, 100)
FlyButton.Font = Enum.Font.Code
FlyButton.TextSize = 10
FlyButton.Parent = UniversalScroll

local InvisibleButton = Instance.new("TextButton")
InvisibleButton.Size = UDim2.new(1, -20, 0, 25)
InvisibleButton.Position = UDim2.new(0, 10, 0, 130)
InvisibleButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
InvisibleButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
InvisibleButton.Text = "Invisible"
InvisibleButton.TextColor3 = Color3.fromRGB(255, 100, 100)
InvisibleButton.Font = Enum.Font.Code
InvisibleButton.TextSize = 10
InvisibleButton.Parent = UniversalScroll

local SpeedButton = Instance.new("TextButton")
SpeedButton.Size = UDim2.new(1, -20, 0, 25)
SpeedButton.Position = UDim2.new(0, 10, 0, 160)
SpeedButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
SpeedButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
SpeedButton.Text = "Speed"
SpeedButton.TextColor3 = Color3.fromRGB(255, 100, 100)
SpeedButton.Font = Enum.Font.Code
SpeedButton.TextSize = 10
SpeedButton.Parent = UniversalScroll

local SpeedTextBox = Instance.new("TextBox")
SpeedTextBox.Size = UDim2.new(0.3, 0, 1, -4)
SpeedTextBox.Position = UDim2.new(0.7, 0, 0, 2)
SpeedTextBox.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
SpeedTextBox.BorderColor3 = Color3.fromRGB(255, 50, 50)
SpeedTextBox.PlaceholderText = "Value"
SpeedTextBox.Text = ""
SpeedTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
SpeedTextBox.Font = Enum.Font.Code
SpeedTextBox.TextSize = 10
SpeedTextBox.ClearTextOnFocus = false
SpeedTextBox.Parent = SpeedButton

local JumpButton = Instance.new("TextButton")
JumpButton.Size = UDim2.new(1, -20, 0, 25)
JumpButton.Position = UDim2.new(0, 10, 0, 190)
JumpButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
JumpButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
JumpButton.Text = "Jump"
JumpButton.TextColor3 = Color3.fromRGB(255, 100, 100)
JumpButton.Font = Enum.Font.Code
JumpButton.TextSize = 10
JumpButton.Parent = UniversalScroll

local JumpTextBox = Instance.new("TextBox")
JumpTextBox.Size = UDim2.new(0.3, 0, 1, -4)
JumpTextBox.Position = UDim2.new(0.7, 0, 0, 2)
JumpTextBox.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
JumpTextBox.BorderColor3 = Color3.fromRGB(255, 50, 50)
JumpTextBox.PlaceholderText = "Value"
JumpTextBox.Text = ""
JumpTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
JumpTextBox.Font = Enum.Font.Code
JumpTextBox.TextSize = 10
JumpTextBox.ClearTextOnFocus = false
JumpTextBox.Parent = JumpButton

local XrayButton = Instance.new("TextButton")
XrayButton.Size = UDim2.new(1, -20, 0, 25)
XrayButton.Position = UDim2.new(0, 10, 0, 220)
XrayButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
XrayButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
XrayButton.Text = "Xray"
XrayButton.TextColor3 = Color3.fromRGB(255, 100, 100)
XrayButton.Font = Enum.Font.Code
XrayButton.TextSize = 10
XrayButton.Parent = UniversalScroll

local AntiLagButton = Instance.new("TextButton")
AntiLagButton.Size = UDim2.new(1, -20, 0, 25)
AntiLagButton.Position = UDim2.new(0, 10, 0, 250)
AntiLagButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
AntiLagButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
AntiLagButton.Text = "AntiLag"
AntiLagButton.TextColor3 = Color3.fromRGB(255, 100, 100)
AntiLagButton.Font = Enum.Font.Code
AntiLagButton.TextSize = 10
AntiLagButton.Parent = UniversalScroll

local DexButton = Instance.new("TextButton")
DexButton.Size = UDim2.new(1, -20, 0, 25)
DexButton.Position = UDim2.new(0, 10, 0, 280)
DexButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
DexButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
DexButton.Text = "Dex Explorer"
DexButton.TextColor3 = Color3.fromRGB(255, 100, 100)
DexButton.Font = Enum.Font.Code
DexButton.TextSize = 10
DexButton.Parent = UniversalScroll

UniversalScroll.CanvasSize = UDim2.new(0, 0, 0, 310)

local PrisonLifeFrame = Instance.new("Frame")
PrisonLifeFrame.Size = UDim2.new(1, 0, 1, 0)
PrisonLifeFrame.Position = UDim2.new(0, 0, 0, 0)
PrisonLifeFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
PrisonLifeFrame.BackgroundTransparency = 0.2
PrisonLifeFrame.BorderColor3 = Color3.fromRGB(150, 0, 0)
PrisonLifeFrame.Visible = false
PrisonLifeFrame.Parent = Pages.Main

local PrisonLifeScroll = Instance.new("ScrollingFrame")
PrisonLifeScroll.Size = UDim2.new(1, -10, 1, -10)
PrisonLifeScroll.Position = UDim2.new(0, 5, 0, 5)
PrisonLifeScroll.BackgroundTransparency = 1
PrisonLifeScroll.ScrollBarThickness = 5
PrisonLifeScroll.ScrollBarImageColor3 = Color3.fromRGB(255, 50, 50)
PrisonLifeScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
PrisonLifeScroll.Parent = PrisonLifeFrame

local BackButton = Instance.new("TextButton")
BackButton.Size = UDim2.new(1, -20, 0, 25)
BackButton.Position = UDim2.new(0, 10, 0, 10)
BackButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
BackButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
BackButton.Text = "Back"
BackButton.TextColor3 = Color3.fromRGB(255, 100, 100)
BackButton.Font = Enum.Font.Code
BackButton.TextSize = 10
BackButton.Parent = PrisonLifeScroll

local teleportLocations = {
    ["AK47"] = {cframe = CFrame.new(-932, 94, 2039), returnBack = true},
    ["M4A1"] = {cframe = CFrame.new(847, 101, 2229), returnBack = true},
    ["MP5"] = {cframe = CFrame.new(814, 101, 2229), returnBack = true},
    ["RE870"] = {cframe = CFrame.new(820, 101, 2229), returnBack = true},
    ["Criminal Base"] = {cframe = CFrame.new(-976, 108, 2045), returnBack = false},
    ["Yard"] = {cframe = CFrame.new(823, 126, 2600), returnBack = false}
}

local teleportButtons = {}
local buttonY = 40
for weaponName, data in pairs(teleportLocations) do
    local teleportButton = Instance.new("TextButton")
    teleportButton.Size = UDim2.new(1, -20, 0, 25)
    teleportButton.Position = UDim2.new(0, 10, 0, buttonY)
    teleportButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
    teleportButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
    teleportButton.Text = weaponName
    teleportButton.TextColor3 = Color3.fromRGB(255, 100, 100)
    teleportButton.Font = Enum.Font.Code
    teleportButton.TextSize = 10
    teleportButton.Parent = PrisonLifeScroll
    
    teleportButtons[weaponName] = teleportButton
    buttonY = buttonY + 30
end

local HitboxButton = Instance.new("TextButton")
HitboxButton.Size = UDim2.new(1, -20, 0, 25)
HitboxButton.Position = UDim2.new(0, 10, 0, buttonY)
HitboxButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
HitboxButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
HitboxButton.Text = "Hitbox"
HitboxButton.TextColor3 = Color3.fromRGB(255, 100, 100)
HitboxButton.Font = Enum.Font.Code
HitboxButton.TextSize = 10
HitboxButton.Parent = PrisonLifeScroll

local FireRateButton = Instance.new("TextButton")
FireRateButton.Size = UDim2.new(1, -20, 0, 25)
FireRateButton.Position = UDim2.new(0, 10, 0, buttonY + 30)
FireRateButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
FireRateButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
FireRateButton.Text = "Fire Rate"
FireRateButton.TextColor3 = Color3.fromRGB(255, 100, 100)
FireRateButton.Font = Enum.Font.Code
FireRateButton.TextSize = 10
FireRateButton.Parent = PrisonLifeScroll

PrisonLifeScroll.CanvasSize = UDim2.new(0, 0, 0, buttonY + 60)

local SpecterFrame = Instance.new("Frame")
SpecterFrame.Size = UDim2.new(1, 0, 1, 0)
SpecterFrame.Position = UDim2.new(0, 0, 0, 0)
SpecterFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
SpecterFrame.BackgroundTransparency = 0.2
SpecterFrame.BorderColor3 = Color3.fromRGB(150, 0, 0)
SpecterFrame.Visible = false
SpecterFrame.Parent = Pages.Main

local SpecterScroll = Instance.new("ScrollingFrame")
SpecterScroll.Size = UDim2.new(1, -10, 1, -10)
SpecterScroll.Position = UDim2.new(0, 5, 0, 5)
SpecterScroll.BackgroundTransparency = 1
SpecterScroll.ScrollBarThickness = 5
SpecterScroll.ScrollBarImageColor3 = Color3.fromRGB(255, 50, 50)
SpecterScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
SpecterScroll.Parent = SpecterFrame

local SpecterBackButton = Instance.new("TextButton")
SpecterBackButton.Size = UDim2.new(1, -20, 0, 25)
SpecterBackButton.Position = UDim2.new(0, 10, 0, 10)
SpecterBackButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
SpecterBackButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
SpecterBackButton.Text = "Back"
SpecterBackButton.TextColor3 = Color3.fromRGB(255, 100, 100)
SpecterBackButton.Font = Enum.Font.Code
SpecterBackButton.TextSize = 10
SpecterBackButton.Parent = SpecterScroll

local GhostHitboxButton = Instance.new("TextButton")
GhostHitboxButton.Size = UDim2.new(1, -20, 0, 25)
GhostHitboxButton.Position = UDim2.new(0, 10, 0, 40)
GhostHitboxButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
GhostHitboxButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
GhostHitboxButton.Text = "Ghost Hitbox"
GhostHitboxButton.TextColor3 = Color3.fromRGB(255, 100, 100)
GhostHitboxButton.Font = Enum.Font.Code
GhostHitboxButton.TextSize = 10
GhostHitboxButton.Parent = SpecterScroll

local GhostEvidenceButton = Instance.new("TextButton")
GhostEvidenceButton.Size = UDim2.new(1, -20, 0, 25)
GhostEvidenceButton.Position = UDim2.new(0, 10, 0, 70)
GhostEvidenceButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
GhostEvidenceButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
GhostEvidenceButton.Text = "Ghost Evidences"
GhostEvidenceButton.TextColor3 = Color3.fromRGB(255, 100, 100)
GhostEvidenceButton.Font = Enum.Font.Code
GhostEvidenceButton.TextSize = 10
GhostEvidenceButton.Parent = SpecterScroll

local GhostInfoButton = Instance.new("TextButton")
GhostInfoButton.Size = UDim2.new(1, -20, 0, 25)
GhostInfoButton.Position = UDim2.new(0, 10, 0, 100)
GhostInfoButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
GhostInfoButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
GhostInfoButton.Text = "Ghost Info"
GhostInfoButton.TextColor3 = Color3.fromRGB(255, 100, 100)
GhostInfoButton.Font = Enum.Font.Code
GhostInfoButton.TextSize = 10
GhostInfoButton.Parent = SpecterScroll

local NightVisionButton = Instance.new("TextButton")
NightVisionButton.Size = UDim2.new(1, -20, 0, 25)
NightVisionButton.Position = UDim2.new(0, 10, 0, 130)
NightVisionButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
NightVisionButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
NightVisionButton.Text = "Night Vision"
NightVisionButton.TextColor3 = Color3.fromRGB(255, 100, 100)
NightVisionButton.Font = Enum.Font.Code
NightVisionButton.TextSize = 10
NightVisionButton.Parent = SpecterScroll

SpecterScroll.CanvasSize = UDim2.new(0, 0, 0, 160)

local HorrorMansionFrame = Instance.new("Frame")
HorrorMansionFrame.Size = UDim2.new(1, 0, 1, 0)
HorrorMansionFrame.Position = UDim2.new(0, 0, 0, 0)
HorrorMansionFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
HorrorMansionFrame.BackgroundTransparency = 0.2
HorrorMansionFrame.BorderColor3 = Color3.fromRGB(150, 0, 0)
HorrorMansionFrame.Visible = false
HorrorMansionFrame.Parent = Pages.Main

local HorrorMansionScroll = Instance.new("ScrollingFrame")
HorrorMansionScroll.Size = UDim2.new(1, -10, 1, -10)
HorrorMansionScroll.Position = UDim2.new(0, 5, 0, 5)
HorrorMansionScroll.BackgroundTransparency = 1
HorrorMansionScroll.ScrollBarThickness = 5
HorrorMansionScroll.ScrollBarImageColor3 = Color3.fromRGB(255, 50, 50)
HorrorMansionScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
HorrorMansionScroll.Parent = HorrorMansionFrame

local HorrorBackButton = Instance.new("TextButton")
HorrorBackButton.Size = UDim2.new(1, -20, 0, 25)
HorrorBackButton.Position = UDim2.new(0, 10, 0, 10)
HorrorBackButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
HorrorBackButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
HorrorBackButton.Text = "Back"
HorrorBackButton.TextColor3 = Color3.fromRGB(255, 100, 100)
HorrorBackButton.Font = Enum.Font.Code
HorrorBackButton.TextSize = 10
HorrorBackButton.Parent = HorrorMansionScroll

local KillKillerButton = Instance.new("TextButton")
KillKillerButton.Size = UDim2.new(1, -20, 0, 25)
KillKillerButton.Position = UDim2.new(0, 10, 0, 40)
KillKillerButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
KillKillerButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
KillKillerButton.Text = "Kill Killer"
KillKillerButton.TextColor3 = Color3.fromRGB(255, 100, 100)
KillKillerButton.Font = Enum.Font.Code
KillKillerButton.TextSize = 10
KillKillerButton.Parent = HorrorMansionScroll

local DisappearKillerButton = Instance.new("TextButton")
DisappearKillerButton.Size = UDim2.new(1, -20, 0, 25)
DisappearKillerButton.Position = UDim2.new(0, 10, 0, 70)
DisappearKillerButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
DisappearKillerButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
DisappearKillerButton.Text = "Hide Killer"
DisappearKillerButton.TextColor3 = Color3.fromRGB(255, 100, 100)
DisappearKillerButton.Font = Enum.Font.Code
DisappearKillerButton.TextSize = 10
DisappearKillerButton.Parent = HorrorMansionScroll

local KillerHitboxButton = Instance.new("TextButton")
KillerHitboxButton.Size = UDim2.new(1, -20, 0, 25)
KillerHitboxButton.Position = UDim2.new(0, 10, 0, 100)
KillerHitboxButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
KillerHitboxButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
KillerHitboxButton.Text = "Killer Hitbox"
KillerHitboxButton.TextColor3 = Color3.fromRGB(255, 100, 100)
KillerHitboxButton.Font = Enum.Font.Code
KillerHitboxButton.TextSize = 10
KillerHitboxButton.Parent = HorrorMansionScroll

local KillerThroughWallsButton = Instance.new("TextButton")
KillerThroughWallsButton.Size = UDim2.new(1, -20, 0, 25)
KillerThroughWallsButton.Position = UDim2.new(0, 10, 0, 130)
KillerThroughWallsButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
KillerThroughWallsButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
KillerThroughWallsButton.Text = "Killer Through Walls"
KillerThroughWallsButton.TextColor3 = Color3.fromRGB(255, 100, 100)
KillerThroughWallsButton.Font = Enum.Font.Code
KillerThroughWallsButton.TextSize = 10
KillerThroughWallsButton.Parent = HorrorMansionScroll

HorrorMansionScroll.CanvasSize = UDim2.new(0, 0, 0, 160)

local CreditsLabel = Instance.new("TextLabel")
CreditsLabel.Size = UDim2.new(1, -20, 1, -20)
CreditsLabel.Position = UDim2.new(0, 10, 0, 10)
CreditsLabel.BackgroundTransparency = 1
CreditsLabel.Text = "Republic of Hackers\nCreator: Splix\nVersion: V1.5\nTheme: Red Animated"
CreditsLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
CreditsLabel.Font = Enum.Font.Code
CreditsLabel.TextSize = 12
CreditsLabel.TextYAlignment = Enum.TextYAlignment.Top
CreditsLabel.Parent = Pages.Credits

local SettingsLabel = Instance.new("TextLabel")
SettingsLabel.Size = UDim2.new(1, -20, 0, 30)
SettingsLabel.Position = UDim2.new(0, 10, 0, 10)
SettingsLabel.BackgroundTransparency = 1
SettingsLabel.Text = "Settings"
SettingsLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
SettingsLabel.Font = Enum.Font.Code
SettingsLabel.TextSize = 16
SettingsLabel.TextXAlignment = Enum.TextXAlignment.Center
SettingsLabel.Parent = Pages.Settings

local TransparencyButton = Instance.new("TextButton")
TransparencyButton.Size = UDim2.new(1, -20, 0, 25)
TransparencyButton.Position = UDim2.new(0, 10, 0, 50)
TransparencyButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
TransparencyButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
TransparencyButton.Text = "Transparency: 0.20"
TransparencyButton.TextColor3 = Color3.fromRGB(255, 100, 100)
TransparencyButton.Font = Enum.Font.Code
TransparencyButton.TextSize = 12
TransparencyButton.Parent = Pages.Settings

local TransparencyTextBox = Instance.new("TextBox")
TransparencyTextBox.Size = UDim2.new(0.2, 0, 1, -4)
TransparencyTextBox.Position = UDim2.new(0.8, 0, 0, 2)
TransparencyTextBox.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
TransparencyTextBox.BorderColor3 = Color3.fromRGB(255, 50, 50)
TransparencyTextBox.PlaceholderText = "0-1"
TransparencyTextBox.Text = "0.20"
TransparencyTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
TransparencyTextBox.Font = Enum.Font.Code
TransparencyTextBox.TextSize = 10
TransparencyTextBox.ClearTextOnFocus = false
TransparencyTextBox.Parent = TransparencyButton

local SizeButton = Instance.new("TextButton")
SizeButton.Size = UDim2.new(1, -20, 0, 25)
SizeButton.Position = UDim2.new(0, 10, 0, 80)
SizeButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
SizeButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
SizeButton.Text = "Size: 300x200"
SizeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
SizeButton.Font = Enum.Font.Code
SizeButton.TextSize = 12
SizeButton.Parent = Pages.Settings

local SizeTextBox = Instance.new("TextBox")
SizeTextBox.Size = UDim2.new(0.2, 0, 1, -4)
SizeTextBox.Position = UDim2.new(0.8, 0, 0, 2)
SizeTextBox.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
SizeTextBox.BorderColor3 = Color3.fromRGB(255, 50, 50)
SizeTextBox.PlaceholderText = "WidthxHeight"
SizeTextBox.Text = "300x200"
SizeTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
SizeTextBox.Font = Enum.Font.Code
SizeTextBox.TextSize = 10
SizeTextBox.ClearTextOnFocus = false
SizeTextBox.Parent = SizeButton

local ApplyButton = Instance.new("TextButton")
ApplyButton.Size = UDim2.new(1, -20, 0, 25)
ApplyButton.Position = UDim2.new(0, 10, 0, 110)
ApplyButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
ApplyButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
ApplyButton.Text = "Apply Changes"
ApplyButton.TextColor3 = Color3.fromRGB(255, 100, 100)
ApplyButton.Font = Enum.Font.Code
ApplyButton.TextSize = 12
ApplyButton.Parent = Pages.Settings

local ResetButton = Instance.new("TextButton")
ResetButton.Size = UDim2.new(1, -20, 0, 25)
ResetButton.Position = UDim2.new(0, 10, 0, 140)
ResetButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
ResetButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
ResetButton.Text = "Reset to Default"
ResetButton.TextColor3 = Color3.fromRGB(255, 100, 100)
ResetButton.Font = Enum.Font.Code
ResetButton.TextSize = 12
ResetButton.Parent = Pages.Settings

local FPSButton = Instance.new("TextButton")
FPSButton.Size = UDim2.new(1, -20, 0, 25)
FPSButton.Position = UDim2.new(0, 10, 0, 170)
FPSButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
FPSButton.BorderColor3 = Color3.fromRGB(255, 50, 50)
FPSButton.Text = "Show FPS Counter"
FPSButton.TextColor3 = Color3.fromRGB(255, 100, 100)
FPSButton.Font = Enum.Font.Code
FPSButton.TextSize = 12
FPSButton.Parent = Pages.Settings

MinimizeButton.Parent = TitleBar
TitleLabel.Parent = TitleBar
TitleBar.Parent = MainFrame

PrevButton.Parent = NavBar
PageLabel.Parent = NavBar
NextButton.Parent = NavBar
NavBar.Parent = MainFrame

DeleteButton.Parent = MainFrame
PagesContainer.Parent = MainFrame
MainFrame.Parent = ScreenGui
ScreenGui.Parent = CoreGui

local currentPage = 1
local pageNames = {"Main", "Settings", "Credits"}
local isMinimized = false
local originalSize = MainFrame.Size
local minimizedSize = UDim2.new(0, 300, 0, 25)
local noclipEnabled = false
local hitboxEnabled = false
local originalHeadSizes = {}
local hitboxLoop
local espEnabled = false
local espLoop
local fireRateActive = false
local toolOriginalRates = {}
local fireRateConnection
local speedEnabled = false
local speedLoop = nil
local speedMonitor = nil
local userSetSpeed = 16
local lastNaturalSpeed = 16
local jumpEnabled = false
local jumpLoop = nil
local jumpMonitor = nil
local userSetJump = 50
local lastNaturalJump = 50
local xrayOn = false
local antiLagEnabled = false
local savedParts = {}
local originalGFX = {}

local ghostHitboxEnabled = false
local ghostEvidenceEnabled = false
local ghostInfoEnabled = false
local ghostHitboxLoop = nil
local ghostEvidenceLoop = nil
local ghostInfoLoop = nil
local evidenceTextLabel = nil
local nightVisionEnabled = false
local nightVisionLoop = nil
local originalBrightness = nil
local nightVisionLight = nil

local invisibleActive = false
local safeZone = CFrame.new(0, 10000, 0)
local realCharacter = nil
local characterClone = nil
local originalCFrame = nil

local killKillerEnabled = false
local disappearKillerEnabled = false
local killerHitboxEnabled = false
local killKillerLoop = nil
local disappearKillerLoop = nil
local killerHitboxLoop = nil
local currentKillerBillboard = nil
local killerThroughWallsEnabled = false
local killerThroughWallsLoop = nil

local originalTransparency = 0.2
local originalSize = UDim2.new(0, 300, 0, 200)
local fpsCounterActive = false
local fpsDisplay = nil
local frameCount = 0
local lastUpdate = tick()
local fpsConnection = nil

local borderLoop = RunService.Heartbeat:Connect(updateBorderColor)

local function showPage(pageIndex)
    for _, page in pairs(Pages) do
        page.Visible = false
    end
    Pages[pageNames[pageIndex]].Visible = true
    PageLabel.Text = pageNames[pageIndex]
    currentPage = pageIndex
end

PrevButton.MouseButton1Click:Connect(function()
    currentPage = currentPage - 1
    if currentPage < 1 then 
        currentPage = #pageNames 
    end
    showPage(currentPage)
end)

NextButton.MouseButton1Click:Connect(function()
    currentPage = currentPage + 1
    if currentPage > #pageNames then 
        currentPage = 1 
    end
    showPage(currentPage)
end)

MinimizeButton.MouseButton1Click:Connect(function()
    if isMinimized then
        MainFrame.Size = originalSize
        MinimizeButton.Text = "-"
        PagesContainer.Visible = true
        NavBar.Visible = true
        isMinimized = false
    else
        MainFrame.Size = minimizedSize
        MinimizeButton.Text = "+"
        PagesContainer.Visible = false
        NavBar.Visible = false
        isMinimized = true
    end
end)

isMinimized = true
MainFrame.Size = minimizedSize
MinimizeButton.Text = "+"
PagesContainer.Visible = false
NavBar.Visible = false

showPage(1)

DeleteButton.MouseButton1Click:Connect(function()
    ScreenGui:Destroy()
end)

UniversalButton.MouseButton1Click:Connect(function()
    UniversalFrame.Visible = true
end)

UniversalBackButton.MouseButton1Click:Connect(function()
    UniversalFrame.Visible = false
end)

PrisonLifeButton.MouseButton1Click:Connect(function()
    PrisonLifeFrame.Visible = true
end)

BackButton.MouseButton1Click:Connect(function()
    PrisonLifeFrame.Visible = false
end)

SpecterButton.MouseButton1Click:Connect(function()
    SpecterFrame.Visible = true
end)

SpecterBackButton.MouseButton1Click:Connect(function()
    SpecterFrame.Visible = false
end)

HorrorMansionButton.MouseButton1Click:Connect(function()
    HorrorMansionFrame.Visible = true
end)

HorrorBackButton.MouseButton1Click:Connect(function()
    HorrorMansionFrame.Visible = false
end)

for weaponName, data in pairs(teleportLocations) do
    teleportButtons[weaponName].MouseButton1Click:Connect(function()
        local character = localPlayer.Character
        if character and character:FindFirstChild("HumanoidRootPart") then
            if data.returnBack then
                local originalPosition = character.HumanoidRootPart.CFrame
                character.HumanoidRootPart.CFrame = data.cframe
                wait(0.5)
                character.HumanoidRootPart.CFrame = originalPosition
            else
                character.HumanoidRootPart.CFrame = data.cframe
            end
        end
    end)
end

local function modifyHitboxes()
    for _, player in pairs(Players:GetPlayers()) do
        if player ~= localPlayer and player.Character then
            local head = player.Character:FindFirstChild("Head")
            if head then
                if not originalHeadSizes[player] then
                    originalHeadSizes[player] = head.Size
                end
                head.Size = Vector3.new(6, 6, 6)
                head.Transparency = 1
            end
        end
    end
end

local function restoreHitboxes()
    for player, originalSize in pairs(originalHeadSizes) do
        if player and player.Character then
            local head = player.Character:FindFirstChild("Head")
            if head then
                head.Size = originalSize
                head.Transparency = 0
            end
        end
    end
    originalHeadSizes = {}
end

HitboxButton.MouseButton1Click:Connect(function()
    hitboxEnabled = not hitboxEnabled
    if hitboxEnabled then
        HitboxButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        HitboxButton.Text = "Hitbox (ON)"
        hitboxLoop = RunService.Heartbeat:Connect(function()
            modifyHitboxes()
        end)
    else
        HitboxButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        HitboxButton.Text = "Hitbox"
        if hitboxLoop then
            hitboxLoop:Disconnect()
        end
        restoreHitboxes()
    end
end)

Players.PlayerAdded:Connect(function(newPlayer)
    if hitboxEnabled then
        newPlayer.CharacterAdded:Connect(function(character)
            wait(1)
            if hitboxEnabled then
                modifyHitboxes()
            end
        end)
    end
end)

local function updateAllTools(applyReduction)
    local backpack = localPlayer:FindFirstChild("Backpack")
    if not backpack then return end
    
    for _, tool in pairs(backpack:GetChildren()) do
        if tool:IsA("Tool") then
            if applyReduction then
                if not toolOriginalRates[tool] then
                    toolOriginalRates[tool] = tool:GetAttribute("FireRate") or 0.12
                end
                tool:SetAttribute("FireRate", toolOriginalRates[tool] * 0.9)
            else
                if toolOriginalRates[tool] then
                    tool:SetAttribute("FireRate", toolOriginalRates[tool])
                end
            end
        end
    end
end

FireRateButton.MouseButton1Click:Connect(function()
    fireRateActive = not fireRateActive
    
    if fireRateActive then
        FireRateButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        FireRateButton.Text = "Fire Rate (ON)"
        
        updateAllTools(true)
        
        if fireRateConnection then
            fireRateConnection:Disconnect()
        end
        
        fireRateConnection = localPlayer.Backpack.ChildAdded:Connect(function(tool)
            if tool:IsA("Tool") then
                wait(0.1)
                if not toolOriginalRates[tool] then
                    toolOriginalRates[tool] = tool:GetAttribute("FireRate") or 0.12
                end
                tool:SetAttribute("FireRate", toolOriginalRates[tool] * 0.9)
            end
        end)
        
    else
        FireRateButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        FireRateButton.Text = "Fire Rate"
        
        if fireRateConnection then
            fireRateConnection:Disconnect()
            fireRateConnection = nil
        end
        
        updateAllTools(false)
    end
end)

local noclipConnection
NoclipButton.MouseButton1Click:Connect(function()
    noclipEnabled = not noclipEnabled
    if noclipEnabled then
        NoclipButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        NoclipButton.Text = "Noclip (ON)"
        noclipConnection = RunService.Stepped:Connect(function()
            if localPlayer.Character then
                for _, part in pairs(localPlayer.Character:GetDescendants()) do
                    if part:IsA("BasePart") then
                        part.CanCollide = false
                    end
                end
            end
        end)
    else
        NoclipButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        NoclipButton.Text = "Noclip"
        if noclipConnection then
            noclipConnection:Disconnect()
            noclipConnection = nil
        end
        if localPlayer.Character then
            for _, part in pairs(localPlayer.Character:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.CanCollide = true
                end
            end
        end
    end
end)

local function updateESP()
    for _, player in pairs(Players:GetPlayers()) do
        if player ~= localPlayer and player.Character then
            local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
            if humanoidRootPart then
                local espBillboard = ScreenGui:FindFirstChild("KlinESP_" .. player.Name)
                
                if not espBillboard then
                    espBillboard = Instance.new("BillboardGui")
                    espBillboard.Name = "KlinESP_" .. player.Name
                    espBillboard.Size = UDim2.new(4, 0, 6, 0)
                    espBillboard.AlwaysOnTop = true
                    espBillboard.MaxDistance = 1000
                    espBillboard.StudsOffset = Vector3.new(0, 0, 0)
                    espBillboard.Adornee = humanoidRootPart
                    espBillboard.Parent = ScreenGui
                    
                    local espFrame = Instance.new("Frame")
                    espFrame.Size = UDim2.new(1, 0, 1, 0)
                    espFrame.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
                    espFrame.BackgroundTransparency = 0.8
                    espFrame.BorderSizePixel = 0
                    espFrame.Parent = espBillboard
                    
                    local nameLabel = Instance.new("TextLabel")
                    nameLabel.Size = UDim2.new(1, 0, 0, 20)
                    nameLabel.Position = UDim2.new(0, 0, -0.3, 0)
                    nameLabel.BackgroundTransparency = 1
                    nameLabel.Text = player.Name
                    nameLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
                    nameLabel.Font = Enum.Font.Code
                    nameLabel.TextSize = 9
                    nameLabel.Parent = espBillboard
                else
                    espBillboard.Adornee = humanoidRootPart
                end
            end
        end
    end
end

local function clearESP()
    for _, child in pairs(ScreenGui:GetChildren()) do
        if string.find(child.Name, "KlinESP_") then
            child:Destroy()
        end
    end
end

EspButton.MouseButton1Click:Connect(function()
    espEnabled = not espEnabled
    if espEnabled then
        EspButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        EspButton.Text = "Esp (ON)"
        espLoop = RunService.Heartbeat:Connect(function()
            updateESP()
        end)
    else
        EspButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        EspButton.Text = "Esp"
        if espLoop then
            espLoop:Disconnect()
        end
        clearESP()
    end
end)

DexButton.MouseButton1Click:Connect(function()
    loadstring(game:HttpGet("https://raw.githubusercontent.com/infyiff/backup/main/dex.lua"))()
end)

local function createClone()
    local char = localPlayer.Character
    if not char then return nil end
    
    char.Archivable = true
    local clone = char:Clone()
    clone.Parent = workspace
    
    for _, descendant in pairs(clone:GetDescendants()) do
        if descendant:IsA("Sound") or 
           descendant:IsA("ParticleEmitter") or 
           descendant:IsA("Trail") or 
           descendant:IsA("ForceField") then
            descendant:Destroy()
        end
    end
    
    local humanoid = clone:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.WalkSpeed = 30
        humanoid.JumpPower = 50
        humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
    end
    
    for _, part in pairs(clone:GetDescendants()) do
        if part:IsA("BasePart") then
            part.Transparency = 0.7
            part.CanCollide = true
            part.Anchored = false
        end
    end
    
    for _, descendant in pairs(clone:GetDescendants()) do
        if descendant:IsA("Script") or descendant:IsA("LocalScript") then
            descendant:Destroy()
        end
    end
    
    return clone
end

local function enableInvisibility()
    if invisibleActive then return end
    
    local char = localPlayer.Character
    if not char then return end
    
    local rootPart = char:FindFirstChild("HumanoidRootPart")
    if not rootPart then return end
    
    realCharacter = char
    originalCFrame = rootPart.CFrame
    
    characterClone = createClone()
    if characterClone and characterClone.PrimaryPart then
        characterClone:SetPrimaryPartCFrame(originalCFrame)
    end
    
    local safePosition = Vector3.new(0, 100000, 0)
    
    if rootPart then
        rootPart.CFrame = CFrame.new(safePosition)
    end
    
    wait(0.05)
    if char.PrimaryPart then
        char:SetPrimaryPartCFrame(CFrame.new(safePosition))
    end
    
    wait(0.05)
    for _, part in pairs(char:GetDescendants()) do
        if part:IsA("BasePart") then
            local offset = Vector3.new(
                math.random(-5, 5),
                0,
                math.random(-5, 5)
            )
            part.CFrame = CFrame.new(safePosition + offset)
            part.Anchored = true
            part.Transparency = 1
            part.CanCollide = false
            
            part.Velocity = Vector3.new(0, 0, 0)
            part.RotVelocity = Vector3.new(0, 0, 0)
        end
    end
    
    wait(0.1)
    if rootPart then
        local distance = (rootPart.Position - safePosition).Magnitude
        
        if distance > 50 then
            rootPart.Anchored = false
            rootPart.CFrame = CFrame.new(safePosition)
            rootPart.Anchored = true
            
            wait(0.05)
        end
    end
    
    local realHumanoid = char:FindFirstChild("Humanoid")
    if realHumanoid then
        realHumanoid.WalkSpeed = 0
        realHumanoid.JumpPower = 0
        realHumanoid.PlatformStand = true
        realHumanoid:ChangeState(Enum.HumanoidStateType.Physics)
    end
    
    local staticAnchor = workspace:FindFirstChild("InvisibleStaticAnchor")
    if not staticAnchor then
        staticAnchor = Instance.new("Part")
        staticAnchor.Name = "InvisibleStaticAnchor"
        staticAnchor.Size = Vector3.new(100, 1, 100)
        staticAnchor.Position = safePosition - Vector3.new(0, 3, 0)
        staticAnchor.Anchored = true
        staticAnchor.CanCollide = true
        staticAnchor.Transparency = 1
        staticAnchor.Parent = workspace
    end
    
    if characterClone then
        local cloneHumanoid = characterClone:FindFirstChild("Humanoid")
        if cloneHumanoid then
            workspace.CurrentCamera.CameraSubject = cloneHumanoid
            localPlayer.Character = characterClone
        end
    end
    
    invisibleActive = true
    InvisibleButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
    InvisibleButton.Text = "Invisible (ON)"
end

local function disableInvisibility()
    if not invisibleActive then return end
    
    local clonePos = originalCFrame
    if characterClone and characterClone.PrimaryPart then
        clonePos = characterClone.PrimaryPart.CFrame
    end
    
    local staticAnchor = workspace:FindFirstChild("InvisibleStaticAnchor")
    if staticAnchor then
        staticAnchor:Destroy()
    end
    
    if realCharacter then
        for _, part in pairs(realCharacter:GetDescendants()) do
            if part:IsA("BasePart") then
                for _, constraint in pairs(part:GetChildren()) do
                    if constraint:IsA("WeldConstraint") then
                        constraint:Destroy()
                    end
                end
                
                part.Anchored = false
            end
        end
    end
    
    if characterClone then
        characterClone:Destroy()
        characterClone = nil
    end
    
    if realCharacter then
        if realCharacter.PrimaryPart then
            realCharacter:SetPrimaryPartCFrame(clonePos)
        end
        
        for _, part in pairs(realCharacter:GetDescendants()) do
            if part:IsA("BasePart") then
                part.Transparency = 0
                part.CanCollide = true
            end
        end
        
        local realHumanoid = realCharacter:FindFirstChild("Humanoid")
        if realHumanoid then
            realHumanoid.WalkSpeed = 16
            realHumanoid.JumpPower = 50
            realHumanoid.Sit = false
            realHumanoid.PlatformStand = false
            realHumanoid.AutoRotate = true
            
            wait(0.1)
            realHumanoid.Health = 0
        end
        
        wait(0.2)
        localPlayer.Character = realCharacter
        if realHumanoid then
            workspace.CurrentCamera.CameraSubject = realHumanoid
        end
    end
    
    invisibleActive = false
    realCharacter = nil
    originalCFrame = nil
    
    InvisibleButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
    InvisibleButton.Text = "Invisible"
end

InvisibleButton.MouseButton1Click:Connect(function()
    if not invisibleActive then
        enableInvisibility()
    else
        disableInvisibility()
    end
end)

local function setupDeathDetection(character)
    wait(0.5)
    
    local humanoid = character:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.Died:Connect(function()
            if invisibleActive then
                disableInvisibility()
            end
        end)
    end
end

localPlayer.CharacterAdded:Connect(setupDeathDetection)
if localPlayer.Character then
    setupDeathDetection(localPlayer.Character)
end

local function getPlayerSpeed()
    local character = localPlayer.Character
    if character then
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid then
            return math.floor(humanoid.WalkSpeed)
        end
    end
    return 16
end

local function updateNaturalSpeed()
    if not speedEnabled then
        lastNaturalSpeed = getPlayerSpeed()
    end
end

local function startSpeedMonitor()
    if speedMonitor then
        speedMonitor:Disconnect()
    end
    
    speedMonitor = RunService.Heartbeat:Connect(function()
        local currentSpeed = getPlayerSpeed()
        SpeedTextBox.Text = tostring(currentSpeed)
        updateNaturalSpeed()
    end)
end

SpeedButton.MouseButton1Click:Connect(function()
    speedEnabled = not speedEnabled
    
    if speedEnabled then
        SpeedButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        SpeedButton.Text = "Speed (ON)"
        
        lastNaturalSpeed = getPlayerSpeed()
        
        if speedMonitor then
            speedMonitor:Disconnect()
            speedMonitor = nil
        end
        
        if speedLoop then
            speedLoop:Disconnect()
        end
        
        speedLoop = RunService.Heartbeat:Connect(function()
            local character = localPlayer.Character
            if character then
                local humanoid = character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid.WalkSpeed = userSetSpeed
                end
            end
        end)
        
        SpeedTextBox.Text = tostring(userSetSpeed)
        
    else
        SpeedButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        SpeedButton.Text = "Speed"
        
        if speedLoop then
            speedLoop:Disconnect()
            speedLoop = nil
        end
        
        local character = localPlayer.Character
        if character then
            local humanoid = character:FindFirstChild("Humanoid")
            if humanoid then
                humanoid.WalkSpeed = lastNaturalSpeed
            end
        end
        
        startSpeedMonitor()
    end
end)

SpeedTextBox.FocusLost:Connect(function(enterPressed)
    local newSpeed = tonumber(SpeedTextBox.Text)
    if newSpeed and newSpeed >= 0 and newSpeed <= 1000 then
        userSetSpeed = newSpeed
        
        if speedEnabled then
            if speedLoop then
                speedLoop:Disconnect()
            end
            
            speedLoop = RunService.Heartbeat:Connect(function()
                local character = localPlayer.Character
                if character then
                    local humanoid = character:FindFirstChild("Humanoid")
                    if humanoid then
                        humanoid.WalkSpeed = userSetSpeed
                    end
                end
            end)
        end
    else
        local currentSpeed = getPlayerSpeed()
        SpeedTextBox.Text = tostring(currentSpeed)
    end
end)

localPlayer.CharacterAdded:Connect(function(character)
    wait(0.5)
    
    if speedEnabled then
        SpeedButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        SpeedButton.Text = "Speed (ON)"
        
        if speedLoop then
            speedLoop:Disconnect()
        end
        
        speedLoop = RunService.Heartbeat:Connect(function()
            if character then
                local humanoid = character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid.WalkSpeed = userSetSpeed
                end
            end
        end)
        
        SpeedTextBox.Text = tostring(userSetSpeed)
        
        if speedMonitor then
            speedMonitor:Disconnect()
            speedMonitor = nil
        end
    else
        SpeedButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        SpeedButton.Text = "Speed"
        
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid then
            humanoid.WalkSpeed = lastNaturalSpeed
        end
        
        startSpeedMonitor()
    end
end)

wait(1)
lastNaturalSpeed = getPlayerSpeed()
SpeedTextBox.Text = tostring(lastNaturalSpeed)
startSpeedMonitor()

local function getPlayerJump()
    local character = localPlayer.Character
    if character then
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid then
            return math.floor(humanoid.JumpPower)
        end
    end
    return 50
end

local function updateNaturalJump()
    if not jumpEnabled then
        lastNaturalJump = getPlayerJump()
    end
end

local function startJumpMonitor()
    if jumpMonitor then
        jumpMonitor:Disconnect()
    end
    
    jumpMonitor = RunService.Heartbeat:Connect(function()
        local currentJump = getPlayerJump()
        JumpTextBox.Text = tostring(currentJump)
        updateNaturalJump()
    end)
end

JumpButton.MouseButton1Click:Connect(function()
    jumpEnabled = not jumpEnabled
    
    if jumpEnabled then
        JumpButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        JumpButton.Text = "Jump (ON)"
        
        lastNaturalJump = getPlayerJump()
        
        if jumpMonitor then
            jumpMonitor:Disconnect()
            jumpMonitor = nil
        end
        
        if jumpLoop then
            jumpLoop:Disconnect()
        end
        
        jumpLoop = RunService.Heartbeat:Connect(function()
            local character = localPlayer.Character
            if character then
                local humanoid = character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid.JumpPower = userSetJump
                end
            end
        end)
        
        JumpTextBox.Text = tostring(userSetJump)
        
    else
        JumpButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        JumpButton.Text = "Jump"
        
        if jumpLoop then
            jumpLoop:Disconnect()
            jumpLoop = nil
        end
        
        local character = localPlayer.Character
        if character then
            local humanoid = character:FindFirstChild("Humanoid")
            if humanoid then
                humanoid.JumpPower = lastNaturalJump
            end
        end
        
        startJumpMonitor()
    end
end)

JumpTextBox.FocusLost:Connect(function(enterPressed)
    local newJump = tonumber(JumpTextBox.Text)
    if newJump and newJump >= 0 and newJump <= 1000 then
        userSetJump = newJump
        
        if jumpEnabled then
            if jumpLoop then
                jumpLoop:Disconnect()
            end
            
            jumpLoop = RunService.Heartbeat:Connect(function()
                local character = localPlayer.Character
                if character then
                    local humanoid = character:FindFirstChild("Humanoid")
                    if humanoid then
                        humanoid.JumpPower = userSetJump
                    end
                end
            end)
        end
    else
        local currentJump = getPlayerJump()
        JumpTextBox.Text = tostring(currentJump)
    end
end)

localPlayer.CharacterAdded:Connect(function(character)
    wait(0.5)
    
    if jumpEnabled then
        JumpButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        JumpButton.Text = "Jump (ON)"
        
        if jumpLoop then
            jumpLoop:Disconnect()
        end
        
        jumpLoop = RunService.Heartbeat:Connect(function()
            if character then
                local humanoid = character:FindFirstChild("Humanoid")
                if humanoid then
                    humanoid.JumpPower = userSetJump
                end
            end
        end)
        
        JumpTextBox.Text = tostring(userSetJump)
        
        if jumpMonitor then
            jumpMonitor:Disconnect()
            jumpMonitor = nil
        end
    else
        JumpButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        JumpButton.Text = "Jump"
        
        local humanoid = character:FindFirstChild("Humanoid")
        if humanoid then
            humanoid.JumpPower = lastNaturalJump
        end
        
        startJumpMonitor()
    end
end)

wait(1)
lastNaturalJump = getPlayerJump()
JumpTextBox.Text = tostring(lastNaturalJump)
startJumpMonitor()

local function toggleXray()
    if xrayOn then
        for part, trans in pairs(savedParts) do
            if part and part.Parent then
                part.Transparency = trans
            end
        end
        savedParts = {}
        XrayButton.Text = "Xray"
        XrayButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
    else
        for _, part in pairs(workspace:GetDescendants()) do
            if part:IsA("BasePart") and part.Transparency < 0.5 then
                if part.Size.Magnitude > 5 and not part:IsDescendantOf(game.Players) then
                    savedParts[part] = part.Transparency
                    part.Transparency = 0.7
                end
            end
        end
        XrayButton.Text = "Xray (ON)"
        XrayButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
    end
    xrayOn = not xrayOn
end

XrayButton.MouseButton1Click:Connect(toggleXray)

ScreenGui.Destroying:Connect(function()
    if xrayOn then
        for part, trans in pairs(savedParts) do
            if part and part.Parent then
                part.Transparency = trans
            end
        end
    end
end)

FlyButton.MouseButton1Click:Connect(function()
    loadstring(game:HttpGet("https://raw.githubusercontent.com/XNEOFF/FlyGuiV3/main/FlyGuiV3.txt"))()
end)

local function saveOriginalGFX()
    local Lighting = game:GetService("Lighting")
    
    originalGFX = {
        GlobalShadows = Lighting.GlobalShadows,
        Technology = Lighting.Technology,
        Brightness = Lighting.Brightness,
        FogEnd = Lighting.FogEnd,
        QualityLevel = settings().Rendering.QualityLevel,
        Atmosphere = nil,
        Effects = {}
    }
    
    local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere")
    if atmosphere then
        originalGFX.Atmosphere = {
            Density = atmosphere.Density,
            Offset = atmosphere.Offset,
            Color = atmosphere.Color,
            Decay = atmosphere.Decay,
            Glare = atmosphere.Glare,
            Haze = atmosphere.Haze
        }
    end
    
    for _, effect in pairs(Lighting:GetChildren()) do
        if effect:IsA("BloomEffect") or effect:IsA("BlurEffect") or 
           effect:IsA("SunRaysEffect") or effect:IsA("ColorCorrectionEffect") then
            originalGFX.Effects[effect] = effect.Enabled
        end
    end
end

saveOriginalGFX()

local function removeAllTextures()
    savedParts = {}
    
    for _, obj in pairs(workspace:GetDescendants()) do
        if obj:IsA("BasePart") then
            local isPlayer = false
            local parent = obj.Parent
            while parent do
                if parent:IsA("Model") and game.Players:GetPlayerFromCharacter(parent) then
                    isPlayer = true
                    break
                end
                parent = parent.Parent
            end
            
            if not isPlayer then
                savedParts[obj] = {
                    Texture = obj.TextureID,
                    Material = obj.Material,
                    Color = obj.Color,
                    Reflectance = obj.Reflectance,
                    Transparency = obj.Transparency
                }
                
                obj.TextureID = ""
                obj.Material = Enum.Material.SmoothPlastic
                obj.Color = Color3.fromRGB(100, 100, 100)
                obj.Reflectance = 0
                obj.Transparency = 0
            end
        end
        
        if obj:IsA("SurfaceAppearance") then
            savedParts[obj] = { Parent = obj.Parent }
            obj:Destroy()
        end
        
        if obj:IsA("Decal") then
            savedParts[obj] = { 
                Parent = obj.Parent,
                Texture = obj.Texture,
                Transparency = obj.Transparency
            }
            obj.Transparency = 1
        end
        
        if obj:IsA("ParticleEmitter") or obj:IsA("Trail") or 
           obj:IsA("Beam") or obj:IsA("Smoke") or 
           obj:IsA("Fire") or obj:IsA("Sparkles") then
            savedParts[obj] = { Enabled = obj.Enabled }
            obj.Enabled = false
        end
    end
    
    local Terrain = workspace:FindFirstChildOfClass("Terrain")
    if Terrain then
        savedParts[Terrain] = {
            MaterialColors = Terrain.MaterialColors,
            WaterColor = Terrain.WaterColor,
            WaterTransparency = Terrain.WaterTransparency,
            WaterReflectance = Terrain.WaterReflectance,
            Decoration = Terrain.Decoration
        }
        Terrain.MaterialColors = false
        Terrain.Decoration = false
        Terrain.WaterColor = Color3.fromRGB(100, 100, 255)
        Terrain.WaterTransparency = 0.9
        Terrain.WaterReflectance = 0
    end
end

local function restoreAllTextures()
    for obj, data in pairs(savedParts) do
        if obj and (obj.Parent or obj:IsA("Terrain")) then
            if obj:IsA("BasePart") then
                obj.TextureID = data.Texture or ""
                obj.Material = data.Material or Enum.Material.Plastic
                obj.Color = data.Color or Color3.new(1, 1, 1)
                obj.Reflectance = data.Reflectance or 0
                obj.Transparency = data.Transparency or 0
            elseif obj:IsA("Decal") then
                obj.Transparency = data.Transparency or 0
            elseif obj:IsA("ParticleEmitter") or obj:IsA("Trail") or 
                   obj:IsA("Beam") or obj:IsA("Smoke") or 
                   obj:IsA("Fire") or obj:IsA("Sparkles") then
                obj.Enabled = data.Enabled
            elseif obj:IsA("Terrain") then
                obj.MaterialColors = data.MaterialColors
                obj.WaterColor = data.WaterColor
                obj.WaterTransparency = data.WaterTransparency
                obj.WaterReflectance = data.WaterReflectance
                obj.Decoration = data.Decoration
            end
        end
    end
    savedParts = {}
end

local function applyLowGFXSettings()
    local Lighting = game:GetService("Lighting")
    
    Lighting.GlobalShadows = false
    Lighting.Technology = Enum.Technology.Legacy
    Lighting.Brightness = 1
    Lighting.FogEnd = 10000
    
    local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere")
    if atmosphere then
        atmosphere.Density = 0
        atmosphere.Offset = 0
    end
    
    for _, effect in pairs(Lighting:GetChildren()) do
        if effect:IsA("BloomEffect") or effect:IsA("BlurEffect") or 
           effect:IsA("SunRaysEffect") or effect:IsA("ColorCorrectionEffect") then
            effect.Enabled = false
        end
    end
    
    settings().Rendering.QualityLevel = 1
    settings().Rendering.EagerBulkExecution = true
end

local function restoreGFXSettings()
    local Lighting = game:GetService("Lighting")
    
    if originalGFX.GlobalShadows ~= nil then
        Lighting.GlobalShadows = originalGFX.GlobalShadows
    end
    if originalGFX.Technology ~= nil then
        Lighting.Technology = originalGFX.Technology
    end
    if originalGFX.Brightness ~= nil then
        Lighting.Brightness = originalGFX.Brightness
    end
    if originalGFX.FogEnd ~= nil then
        Lighting.FogEnd = originalGFX.FogEnd
    end
    
    local atmosphere = Lighting:FindFirstChildOfClass("Atmosphere")
    if atmosphere and originalGFX.Atmosphere then
        atmosphere.Density = originalGFX.Atmosphere.Density or 0
        atmosphere.Offset = originalGFX.Atmosphere.Offset or 0
        atmosphere.Color = originalGFX.Atmosphere.Color or Color3.new(1, 1, 1)
        atmosphere.Decay = originalGFX.Atmosphere.Decay or Color3.new(1, 1, 1)
        atmosphere.Glare = originalGFX.Atmosphere.Glare or 0
        atmosphere.Haze = originalGFX.Atmosphere.Haze or 0
    end
    
    for effect, enabled in pairs(originalGFX.Effects) do
        if effect and effect.Parent then
            effect.Enabled = enabled
        end
    end
    
    if originalGFX.QualityLevel ~= nil then
        settings().Rendering.QualityLevel = originalGFX.QualityLevel
    end
    settings().Rendering.EagerBulkExecution = false
end

AntiLagButton.MouseButton1Click:Connect(function()
    antiLagEnabled = not antiLagEnabled
    
    if antiLagEnabled then
        AntiLagButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        AntiLagButton.Text = "AntiLag (ON)"
        
        applyLowGFXSettings()
        removeAllTextures()
        
    else
        AntiLagButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        AntiLagButton.Text = "AntiLag"
        
        restoreAllTextures()
        restoreGFXSettings()
        
    end
end)

local function updateGhostHitbox()
    local npcs = workspace:FindFirstChild("NPCs")
    if npcs then
        local globalNPC = npcs:FindFirstChild("GLOBAL")
        if globalNPC then
            local humanoid = globalNPC:FindFirstChild("Humanoid")
            if humanoid then
                local hitboxBillboard = ScreenGui:FindFirstChild("GhostHitboxBillboard")
                
                if not hitboxBillboard then
                    hitboxBillboard = Instance.new("BillboardGui")
                    hitboxBillboard.Name = "GhostHitboxBillboard"
                    hitboxBillboard.Size = UDim2.new(5, 0, 8, 0)
                    hitboxBillboard.AlwaysOnTop = true
                    hitboxBillboard.MaxDistance = 1000
                    hitboxBillboard.StudsOffset = Vector3.new(0, 0, 0)
                    hitboxBillboard.Parent = ScreenGui
                    
                    local hitboxFrame = Instance.new("Frame")
                    hitboxFrame.Size = UDim2.new(1, 0, 1, 0)
                    hitboxFrame.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
                    hitboxFrame.BackgroundTransparency = 0.6
                    hitboxFrame.BorderSizePixel = 2
                    hitboxFrame.BorderColor3 = Color3.fromRGB(255, 100, 100)
                    hitboxFrame.Parent = hitboxBillboard
                    
                    local ghostLabel = Instance.new("TextLabel")
                    ghostLabel.Size = UDim2.new(1, 0, 0, 20)
                    ghostLabel.Position = UDim2.new(0, 0, -0.2, 0)
                    ghostLabel.BackgroundTransparency = 1
                    ghostLabel.Text = "Ghost"
                    ghostLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
                    ghostLabel.Font = Enum.Font.Code
                    ghostLabel.TextSize = 14
                    ghostLabel.Parent = hitboxBillboard
                end
                
                local rootPart = globalNPC:FindFirstChild("HumanoidRootPart") or globalNPC.PrimaryPart
                if rootPart then
                    hitboxBillboard.Adornee = rootPart
                    hitboxBillboard.Enabled = true
                end
                
                for _, part in pairs(globalNPC:GetChildren()) do
                    if part:IsA("BasePart") then
                        part.Transparency = 0.8
                    end
                end
            end
        else
            local hitboxBillboard = ScreenGui:FindFirstChild("GhostHitboxBillboard")
            if hitboxBillboard then
                hitboxBillboard.Enabled = false
            end
        end
    else
        local hitboxBillboard = ScreenGui:FindFirstChild("GhostHitboxBillboard")
        if hitboxBillboard then
            hitboxBillboard.Enabled = false
        end
    end
end

local function clearGhostHitbox()
    local hitboxBillboard = ScreenGui:FindFirstChild("GhostHitboxBillboard")
    if hitboxBillboard then
        hitboxBillboard:Destroy()
    end
    
    local npcs = workspace:FindFirstChild("NPCs")
    if npcs then
        local globalNPC = npcs:FindFirstChild("GLOBAL")
        if globalNPC then
            for _, part in pairs(globalNPC:GetChildren()) do
                if part:IsA("BasePart") then
                    part.Transparency = 0
                end
            end
        end
    end
end

GhostHitboxButton.MouseButton1Click:Connect(function()
    ghostHitboxEnabled = not ghostHitboxEnabled
    
    if ghostHitboxEnabled then
        GhostHitboxButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        GhostHitboxButton.Text = "Ghost Hitbox (ON)"
        
        if ghostHitboxLoop then
            ghostHitboxLoop:Disconnect()
        end
        ghostHitboxLoop = RunService.Heartbeat:Connect(function()
            updateGhostHitbox()
        end)
        
    else
        GhostHitboxButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        GhostHitboxButton.Text = "Ghost Hitbox"
        
        if ghostHitboxLoop then
            ghostHitboxLoop:Disconnect()
            ghostHitboxLoop = nil
        end
        
        clearGhostHitbox()
    end
end)

local function createEvidenceText()
    if not evidenceTextLabel then
        evidenceTextLabel = Instance.new("TextLabel")
        evidenceTextLabel.Name = "EvidenceDisplay"
        evidenceTextLabel.Size = UDim2.new(0, 200, 0, 100)
        evidenceTextLabel.Position = UDim2.new(0, 10, 0, 10)
        evidenceTextLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
        evidenceTextLabel.BackgroundTransparency = 0.7
        evidenceTextLabel.BorderSizePixel = 0
        evidenceTextLabel.Text = "EMF: None\nFingerprints: None\nORBS: None"
        evidenceTextLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
        evidenceTextLabel.Font = Enum.Font.Code
        evidenceTextLabel.TextSize = 12
        evidenceTextLabel.TextXAlignment = Enum.TextXAlignment.Left
        evidenceTextLabel.TextYAlignment = Enum.TextYAlignment.Top
        evidenceTextLabel.Visible = false
        evidenceTextLabel.Parent = ScreenGui
    end
end

local function updateGhostInfo()
    local npcs = workspace:FindFirstChild("NPCs")
    local ghostInfo = ""
    
    if npcs then
        local globalNPC = npcs:FindFirstChild("GLOBAL")
        if globalNPC then
            local humanoid = globalNPC:FindFirstChild("Humanoid")
            if humanoid then
                ghostInfo = string.format("Ghost Speed: %.1f", humanoid.WalkSpeed)
                
                if humanoid.Health then
                    ghostInfo = ghostInfo .. string.format("\nGhost Health: %.0f", humanoid.Health)
                end
                
                local rootPart = globalNPC:FindFirstChild("HumanoidRootPart") or globalNPC.PrimaryPart
                if rootPart then
                    local pos = rootPart.Position
                    ghostInfo = ghostInfo .. string.format("\nPosition: X:%.0f Y:%.0f Z:%.0f", pos.X, pos.Y, pos.Z)
                end
            else
                ghostInfo = "Ghost: Found (No Humanoid)"
            end
        else
            ghostInfo = "Ghost: Not Found"
        end
    else
        ghostInfo = "No NPCs Folder"
    end
    
    return ghostInfo
end

GhostEvidenceButton.MouseButton1Click:Connect(function()
    ghostEvidenceEnabled = not ghostEvidenceEnabled
    
    if ghostEvidenceEnabled then
        GhostEvidenceButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        GhostEvidenceButton.Text = "Ghost Evidences (ON)"
        createEvidenceText()
        if evidenceTextLabel then
            evidenceTextLabel.Visible = true
        end
        
        if ghostEvidenceLoop then
            ghostEvidenceLoop:Disconnect()
        end
        
        ghostEvidenceLoop = RunService.Heartbeat:Connect(function()
            if evidenceTextLabel then
                local evidenceText = ""
                local dynamic = workspace:FindFirstChild("Dynamic")
                
                if dynamic then
                    local evidence = dynamic:FindFirstChild("Evidence")
                    if evidence then
                        evidenceText = "EMF: Checking...\nFingerprints: Checking...\nORBS: Checking..."
                    else
                        evidenceText = "No Evidence Folder"
                    end
                else
                    evidenceText = "No Dynamic Folder"
                end
                
                if ghostInfoEnabled then
                    evidenceText = evidenceText .. "\n\n--- GHOST INFO ---\n" .. updateGhostInfo()
                end
                
                evidenceTextLabel.Text = evidenceText
            end
        end)
        
    else
        GhostEvidenceButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        GhostEvidenceButton.Text = "Ghost Evidences"
        if ghostEvidenceLoop then
            ghostEvidenceLoop:Disconnect()
            ghostEvidenceLoop = nil
        end
        
        if evidenceTextLabel then
            evidenceTextLabel.Visible = false
        end
    end
end)

GhostInfoButton.MouseButton1Click:Connect(function()
    ghostInfoEnabled = not ghostInfoEnabled
    
    if ghostInfoEnabled then
        GhostInfoButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        GhostInfoButton.Text = "Ghost Info (ON)"
        createEvidenceText()
        
        if evidenceTextLabel then
            evidenceTextLabel.Visible = true
        end
        
        if ghostInfoLoop then
            ghostInfoLoop:Disconnect()
        end
        
        ghostInfoLoop = RunService.Heartbeat:Connect(function()
            if evidenceTextLabel then
                evidenceTextLabel.Text = "--- GHOST INFO ---\n" .. updateGhostInfo()
            end
        end)
        
    else
        GhostInfoButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        GhostInfoButton.Text = "Ghost Info"
        
        if ghostInfoLoop then
            ghostInfoLoop:Disconnect()
            ghostInfoLoop = nil
        end
        
        if evidenceTextLabel then
            evidenceTextLabel.Visible = false
        end
    end
end)

local function toggleNightVision()
    if nightVisionEnabled then
        if not originalBrightness then
            originalBrightness = game.Lighting.Brightness
        end
        
        game.Lighting.Brightness = 2
        
        if not nightVisionLight then
            nightVisionLight = Instance.new("PointLight")
            nightVisionLight.Name = "NightVisionLight"
            nightVisionLight.Brightness = 2
            nightVisionLight.Range = 100
            nightVisionLight.Color = Color3.fromRGB(255, 50, 50)
            nightVisionLight.Shadows = false
            
            local character = localPlayer.Character
            if character then
                local head = character:FindFirstChild("Head")
                if head then
                    nightVisionLight.Parent = head
                end
            end
        end
        
        if nightVisionLoop then
            nightVisionLoop:Disconnect()
        end
        nightVisionLoop = RunService.Heartbeat:Connect(function()
            local character = localPlayer.Character
            if character and nightVisionLight then
                local head = character:FindFirstChild("Head")
                if head and nightVisionLight.Parent ~= head then
                    nightVisionLight.Parent = head
                end
            end
        end)
        
    else
        if originalBrightness then
            game.Lighting.Brightness = originalBrightness
            originalBrightness = nil
        end
        
        if nightVisionLight then
            nightVisionLight:Destroy()
            nightVisionLight = nil
        end
        
        if nightVisionLoop then
            nightVisionLoop:Disconnect()
            nightVisionLoop = nil
        end
    end
end

NightVisionButton.MouseButton1Click:Connect(function()
    nightVisionEnabled = not nightVisionEnabled
    
    if nightVisionEnabled then
        NightVisionButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        NightVisionButton.Text = "Night Vision (ON)"
    else
        NightVisionButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        NightVisionButton.Text = "Night Vision"
    end
    
    toggleNightVision()
end)

local function findAllHumanoidsInKiller()
    local humanoids = {}
    local killerFolder = workspace:FindFirstChild("Killer")
    
    if not killerFolder then return humanoids end
    
    local function searchRecursively(current)
        for _, child in pairs(current:GetChildren()) do
            if child:IsA("Humanoid") then
                table.insert(humanoids, {
                    humanoid = child,
                    model = child.Parent
                })
            end
            
            if child:IsA("Folder") or child:IsA("Model") then
                searchRecursively(child)
            end
        end
    end
    
    searchRecursively(killerFolder)
    return humanoids
end

local function killAllKillers()
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        if data.humanoid and data.humanoid.Health > 0 then
            data.humanoid.MaxHealth = 0
            data.humanoid.Health = 0
        end
    end
end

local function hideAllKillers()
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        if data.humanoid then
            data.humanoid.HipHeight = 2048
        end
    end
end

local function restoreAllKillers()
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        if data.humanoid then
            data.humanoid.HipHeight = 0
            data.humanoid.MaxHealth = 100
            data.humanoid.Health = 100
        end
    end
end

local function clearAllKillerHitboxes()
    for _, child in pairs(ScreenGui:GetChildren()) do
        if string.find(child.Name, "KillerHitbox_") then
            child:Destroy()
        end
    end
end

local function updateAllKillerHitboxes()
    local allHumanoids = findAllHumanoidsInKiller()
    
    clearAllKillerHitboxes()
    
    for index, data in pairs(allHumanoids) do
        local killerModel = data.model
        
        if killerModel then
            local rootPart = killerModel:FindFirstChild("HumanoidRootPart") or killerModel.PrimaryPart
            
            if rootPart then
                local killerBillboard = Instance.new("BillboardGui")
                killerBillboard.Name = "KillerHitbox_" .. killerModel.Name .. "_" .. index
                killerBillboard.Size = UDim2.new(4, 0, 6, 0)
                killerBillboard.AlwaysOnTop = true
                killerBillboard.MaxDistance = 1000
                killerBillboard.StudsOffset = Vector3.new(0, 0, 0)
                killerBillboard.Parent = ScreenGui
                
                local hitboxFrame = Instance.new("Frame")
                hitboxFrame.Size = UDim2.new(1, 0, 1, 0)
                hitboxFrame.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
                hitboxFrame.BackgroundTransparency = 0.6
                hitboxFrame.BorderSizePixel = 2
                hitboxFrame.BorderColor3 = Color3.fromRGB(255, 100, 100)
                hitboxFrame.Parent = killerBillboard
                
                local killerLabel = Instance.new("TextLabel")
                killerLabel.Size = UDim2.new(1, 0, 0, 20)
                killerLabel.Position = UDim2.new(0, 0, -0.2, 0)
                killerLabel.BackgroundTransparency = 1
                killerLabel.Text = "Killer"
                killerLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
                killerLabel.Font = Enum.Font.Code
                killerLabel.TextSize = 14
                killerLabel.Parent = killerBillboard
                
                for _, part in pairs(killerModel:GetDescendants()) do
                    if part:IsA("BasePart") then
                        part.Transparency = 0.3
                    end
                end
                
                killerBillboard.Adornee = rootPart
                killerBillboard.Enabled = true
            end
        end
    end
end

local function restoreAllKillerTransparency()
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        local killerModel = data.model
        
        if killerModel then
            for _, part in pairs(killerModel:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.Transparency = 0
                end
            end
        end
    end
end

local function setupKillerDetection()
    local killerFolder = workspace:FindFirstChild("Killer")
    
    if killerFolder then
        local function handleKillerChange()
            if killerHitboxEnabled then
                wait(0.3)
                updateAllKillerHitboxes()
            end
        end
        
        killerFolder.ChildAdded:Connect(handleKillerChange)
        killerFolder.ChildRemoved:Connect(handleKillerChange)
    end
end

spawn(function()
    wait(1.5)
    setupKillerDetection()
end)

KillKillerButton.MouseButton1Click:Connect(function()
    killKillerEnabled = not killKillerEnabled
    if killKillerEnabled then
        KillKillerButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        KillKillerButton.Text = "Kill Killer (ON)"
        killAllKillers()
        
        if killKillerLoop then killKillerLoop:Disconnect() end
        killKillerLoop = RunService.Heartbeat:Connect(function()
            killAllKillers()
        end)
    else
        KillKillerButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        KillKillerButton.Text = "Kill Killer"
        if killKillerLoop then killKillerLoop:Disconnect() killKillerLoop = nil end
    end
end)

DisappearKillerButton.MouseButton1Click:Connect(function()
    disappearKillerEnabled = not disappearKillerEnabled
    if disappearKillerEnabled then
        DisappearKillerButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        DisappearKillerButton.Text = "Hide Killer (ON)"
        hideAllKillers()
        
        if disappearKillerLoop then disappearKillerLoop:Disconnect() end
        disappearKillerLoop = RunService.Heartbeat:Connect(function()
            hideAllKillers()
        end)
    else
        DisappearKillerButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        DisappearKillerButton.Text = "Hide Killer"
        if disappearKillerLoop then disappearKillerLoop:Disconnect() disappearKillerLoop = nil end
        restoreAllKillers()
    end
end)

KillerHitboxButton.MouseButton1Click:Connect(function()
    killerHitboxEnabled = not killerHitboxEnabled
    if killerHitboxEnabled then
        KillerHitboxButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        KillerHitboxButton.Text = "Killer Hitbox (ON)"
        
        clearAllKillerHitboxes()
        
        if killerHitboxLoop then 
            killerHitboxLoop:Disconnect() 
        end
        
        killerHitboxLoop = RunService.Heartbeat:Connect(function()
            updateAllKillerHitboxes()
        end)
    else
        KillerHitboxButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        KillerHitboxButton.Text = "Killer Hitbox"
        
        if killerHitboxLoop then 
            killerHitboxLoop:Disconnect() 
            killerHitboxLoop = nil 
        end
        
        clearAllKillerHitboxes()
        restoreAllKillerTransparency()
    end
end)

local function applyKillerNoClip(enable)
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        local killerModel = data.model
        if killerModel then
            for _, part in pairs(killerModel:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.CanCollide = not enable
                end
            end
        end
    end
end

local function restoreKillerCollision()
    local allHumanoids = findAllHumanoidsInKiller()
    
    for _, data in pairs(allHumanoids) do
        local killerModel = data.model
        if killerModel then
            for _, part in pairs(killerModel:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.CanCollide = true
                end
            end
        end
    end
end

KillerThroughWallsButton.MouseButton1Click:Connect(function()
    killerThroughWallsEnabled = not killerThroughWallsEnabled
    
    if killerThroughWallsEnabled then
        KillerThroughWallsButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        KillerThroughWallsButton.Text = "Killer Through Walls (ON)"
        
        applyKillerNoClip(true)
        
        if killerThroughWallsLoop then
            killerThroughWallsLoop:Disconnect()
        end
        
        killerThroughWallsLoop = RunService.Heartbeat:Connect(function()
            applyKillerNoClip(true)
        end)
        
    else
        KillerThroughWallsButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
        KillerThroughWallsButton.Text = "Killer Through Walls"
        
        if killerThroughWallsLoop then
            killerThroughWallsLoop:Disconnect()
            killerThroughWallsLoop = nil
        end
        
        restoreKillerCollision()
    end
end)

local function applySettingsChanges()
    local transparencyText = TransparencyTextBox.Text
    local transparency = tonumber(transparencyText)
    
    if transparency and transparency >= 0 and transparency <= 1 then
        MainFrame.BackgroundTransparency = transparency
        UniversalFrame.BackgroundTransparency = transparency
        PrisonLifeFrame.BackgroundTransparency = transparency
        SpecterFrame.BackgroundTransparency = transparency
        HorrorMansionFrame.BackgroundTransparency = transparency
        
        TransparencyButton.Text = "Transparency: " .. string.format("%.2f", transparency)
    else
        TransparencyTextBox.Text = string.format("%.2f", MainFrame.BackgroundTransparency)
    end
    
    local sizeText = SizeTextBox.Text
    local width, height = sizeText:match("(%d+)x(%d+)")
    
    if width and height then
        width = tonumber(width)
        height = tonumber(height)
        
        if width and height and width >= 200 and width <= 500 and height >= 150 and height <= 400 then
            originalSize = UDim2.new(0, width, 0, height)
            
            if not isMinimized then
                MainFrame.Size = originalSize
            end
            
            SizeButton.Text = "Size: " .. width .. "x" .. height
        else
            SizeTextBox.Text = string.format("%dx%d", MainFrame.Size.X.Offset, MainFrame.Size.Y.Offset)
        end
    else
        SizeTextBox.Text = string.format("%dx%d", MainFrame.Size.X.Offset, MainFrame.Size.Y.Offset)
    end
end

local function resetToDefaults()
    MainFrame.BackgroundTransparency = originalTransparency
    UniversalFrame.BackgroundTransparency = originalTransparency
    PrisonLifeFrame.BackgroundTransparency = originalTransparency
    SpecterFrame.BackgroundTransparency = originalTransparency
    HorrorMansionFrame.BackgroundTransparency = originalTransparency
    
    TransparencyTextBox.Text = string.format("%.2f", originalTransparency)
    TransparencyButton.Text = "Transparency: " .. string.format("%.2f", originalTransparency)
    
    local defaultWidth = 300
    local defaultHeight = 200
    originalSize = UDim2.new(0, defaultWidth, 0, defaultHeight)
    
    if not isMinimized then
        MainFrame.Size = originalSize
    end
    
    SizeTextBox.Text = defaultWidth .. "x" .. defaultHeight
    SizeButton.Text = "Size: " .. defaultWidth .. "x" .. defaultHeight
    
    TransparencyTextBox.Text = string.format("%.2f", originalTransparency)
    SizeTextBox.Text = "300x200"
end

ApplyButton.MouseButton1Click:Connect(function()
    applySettingsChanges()
    
    ApplyButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
    ApplyButton.Text = "Applied!"
    
    wait(0.5)
    
    ApplyButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    ApplyButton.Text = "Apply Changes"
end)

ResetButton.MouseButton1Click:Connect(function()
    resetToDefaults()
    
    ResetButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
    ResetButton.Text = "Reset!"
    
    wait(0.5)
    
    ResetButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    ResetButton.Text = "Reset to Default"
end)

local function createFPSDisplay()
    if fpsDisplay and fpsDisplay.Parent then
        fpsDisplay:Destroy()
    end
    
    fpsDisplay = Instance.new("ScreenGui")
    fpsDisplay.Name = "KlinFPSCounter"
    fpsDisplay.ResetOnSpawn = false
    fpsDisplay.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
    fpsDisplay.DisplayOrder = 999
    
    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(0, 80, 0, 25)
    frame.Position = UDim2.new(1, -85, 0, 5)
    frame.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
    frame.BackgroundTransparency = 0.3
    frame.BorderSizePixel = 1
    frame.BorderColor3 = Color3.fromRGB(255, 50, 50)
    
    local fpsLabel = Instance.new("TextLabel")
    fpsLabel.Name = "FPSLabel"
    fpsLabel.Size = UDim2.new(1, 0, 1, 0)
    fpsLabel.BackgroundTransparency = 1
    fpsLabel.Text = "FPS: 60"
    fpsLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
    fpsLabel.Font = Enum.Font.Code
    fpsLabel.TextSize = 12
    fpsLabel.TextXAlignment = Enum.TextXAlignment.Center
    fpsLabel.TextYAlignment = Enum.TextYAlignment.Center
    
    fpsLabel.Parent = frame
    frame.Parent = fpsDisplay
    fpsDisplay.Parent = CoreGui
    
    frame.Active = false
    frame.Draggable = false
end

local function updateFPS()
    frameCount = frameCount + 1
    local currentTime = tick()
    
    if currentTime - lastUpdate >= 0.5 then
        local fps = math.floor(frameCount / (currentTime - lastUpdate))
        frameCount = 0
        lastUpdate = currentTime
        
        if fpsDisplay and fpsDisplay:FindFirstChild("Frame") then
            local frame = fpsDisplay.Frame
            if frame and frame:FindFirstChild("FPSLabel") then
                frame.FPSLabel.Text = "FPS: " .. fps
                
                if fps < 20 then
                    frame.FPSLabel.TextColor3 = Color3.fromRGB(255, 50, 50)
                    frame.BorderColor3 = Color3.fromRGB(255, 50, 50)
                elseif fps < 40 then
                    frame.FPSLabel.TextColor3 = Color3.fromRGB(255, 165, 50)
                    frame.BorderColor3 = Color3.fromRGB(255, 165, 50)
                else
                    frame.FPSLabel.TextColor3 = Color3.fromRGB(100, 255, 100)
                    frame.BorderColor3 = Color3.fromRGB(100, 255, 100)
                end
            end
        end
    end
end

local function toggleFPSCounter()
    fpsCounterActive = not fpsCounterActive
    
    if fpsCounterActive then
        createFPSDisplay()
        
        FPSButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        FPSButton.Text = "Hide FPS Counter"
        
        if fpsConnection then
            fpsConnection:Disconnect()
        end
        
        fpsConnection = RunService.RenderStepped:Connect(function()
            if fpsCounterActive and fpsDisplay then
                updateFPS()
            end
        end)
        
    else
        if fpsDisplay then
            fpsDisplay:Destroy()
            fpsDisplay = nil
        end
        
        FPSButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        FPSButton.Text = "Show FPS Counter"
        
        if fpsConnection then
            fpsConnection:Disconnect()
            fpsConnection = nil
        end
        
        frameCount = 0
        lastUpdate = tick()
    end
end

FPSButton.MouseButton1Click:Connect(function()
    toggleFPSCounter()
    
    if fpsCounterActive then
        FPSButton.BackgroundColor3 = Color3.fromRGB(50, 0, 0)
        FPSButton.Text = "Hide FPS Counter"
    else
        FPSButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
        FPSButton.Text = "Show FPS Counter"
    end
end)

local function adjustForMobile()
    if fpsDisplay and fpsDisplay:FindFirstChild("Frame") then
        local frame = fpsDisplay.Frame
        
        frame.Size = UDim2.new(0, 90, 0, 30)
        frame.Position = UDim2.new(1, -152, 0, -30)
        
        if frame:FindFirstChild("FPSLabel") then
            frame.FPSLabel.TextSize = 14
        end
    end
end

local function checkIfMobile()
    local UserInputService = game:GetService("UserInputService")
    return UserInputService.TouchEnabled
end

if checkIfMobile() then
    local originalCreateFPSDisplay = createFPSDisplay
    createFPSDisplay = function()
        originalCreateFPSDisplay()
        adjustForMobile()
    end
end

_G.KlinToggleFPS = toggleFPSCounter

ScreenGui.Destroying:Connect(function()
    clearESP()
    clearGhostHitbox()
    if noclipConnection then noclipConnection:Disconnect() end
    if hitboxLoop then hitboxLoop:Disconnect() end
    if espLoop then espLoop:Disconnect() end
    if fireRateConnection then fireRateConnection:Disconnect() end
    if speedLoop then speedLoop:Disconnect() end
    if jumpLoop then jumpLoop:Disconnect() end
    if jumpMonitor then jumpMonitor:Disconnect() end
    if fpsDisplay then fpsDisplay:Destroy() fpsDisplay = nil end
    if fpsConnection then fpsConnection:Disconnect() fpsConnection = nil end
    if characterClone then characterClone:Destroy() end
    if invisibleActive and realCharacter then disableInvisibility() end
    if characterClone then characterClone:Destroy() characterClone = nil end
    if ghostHitboxLoop then ghostHitboxLoop:Disconnect() end
    if ghostEvidenceLoop then ghostEvidenceLoop:Disconnect() end
    if ghostInfoLoop then ghostInfoLoop:Disconnect() end
    if nightVisionLoop then nightVisionLoop:Disconnect() end
    if nightVisionLight then nightVisionLight:Destroy() end
    if originalBrightness then game.Lighting.Brightness = originalBrightness end
    clearAllKillerHitboxes()
    if antiLagEnabled then restoreAllTextures() restoreGFXSettings() end
    if killKillerLoop then killKillerLoop:Disconnect() end
    if disappearKillerLoop then disappearKillerLoop:Disconnect() end
    if killerHitboxLoop then killerHitboxLoop:Disconnect() end
    if killerThroughWallsLoop then killerThroughWallsLoop:Disconnect() end
end)

Features & Information

Klin V1.5 (Full Version) Release date: 23/12/25
#Universal#Hack#Menu#Premium#Pro

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts