--!
strict
-- Configuration
local CONFIG = {
TOGGLE_KEY = [Link].X,
DEFAULT_SPEED = 16,
BOOSTED_SPEED = 48,
SOUND_ID = "rbxassetid://942127495",
INVISIBILITY_POSITION = [Link](-25.95, 84, 3537.55),
NOTIFICATION_DURATION = 3,
-- UI Colors
BACKGROUND_COLOR = [Link](25, 25, 25),
ACCENT_COLOR = [Link](45, 45, 45),
PRIMARY_COLOR = [Link](0, 170, 255),
SUCCESS_COLOR = [Link](46, 204, 113),
DANGER_COLOR = [Link](231, 76, 60),
WARNING_COLOR = [Link](241, 196, 15),
TEXT_COLOR = [Link](255, 255, 255),
SECONDARY_TEXT_COLOR = [Link](189, 195, 199),
}
-- Types
type PlayerState = {
isInvisible: boolean,
isSpeedBoosted: boolean,
originalSpeed: number,
}
-- Services
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
-- Variables
local player = [Link]
local playerState: PlayerState = {
isInvisible = false,
isSpeedBoosted = false,
originalSpeed = CONFIG.DEFAULT_SPEED,
}
-- GUI Elements
local screenGui: ScreenGui
local mainFrame: Frame
local toggleButton: TextButton
local speedButton: TextButton
local closeButton: TextButton
local signatureLabel: TextLabel
local sound: Sound
-- Utility Functions
local function createNotification(title: string, text: string): ()
StarterGui:SetCore("SendNotification", {
Title = title,
Text = text,
Duration = CONFIG.NOTIFICATION_DURATION,
})
end
local function setCharacterTransparency(character: Model, transparency: number): ()
for _, descendant in character:GetDescendants() do
if descendant:IsA("BasePart") or descendant:IsA("Decal") then
[Link] = transparency
end
end
end
local function getHumanoid(): Humanoid?
local character = [Link]
if not character then
return nil
end
return character:FindFirstChild("Humanoid") :: Humanoid?
end
local function getHumanoidRootPart(): BasePart?
local character = [Link]
if not character then
return nil
end
return character:FindFirstChild("HumanoidRootPart") :: BasePart?
end
local function playSound(): ()
if sound then
sound:Play()
end
end
-- Core Functions
local function toggleInvisibility(): ()
if not [Link] then
warn("Character not found")
return
end
[Link] = not [Link]
playSound()
if [Link] then
local humanoidRootPart = getHumanoidRootPart()
if not humanoidRootPart then
warn("HumanoidRootPart not found")
return
end
local savedPosition = [Link]
-- Move to invisibility position
[Link]:MoveTo(CONFIG.INVISIBILITY_POSITION)
[Link](0.15)
-- Create invisible seat
local seat = [Link]("Seat")
[Link] = "invischair"
[Link] = false
[Link] = false
[Link] = 1
[Link] = CONFIG.INVISIBILITY_POSITION
[Link] = workspace
-- Weld seat to character
local weld = [Link]("Weld")
weld.Part0 = seat
weld.Part1 = [Link]:FindFirstChild("Torso") or
[Link]:FindFirstChild("UpperTorso")
[Link] = seat
[Link]()
[Link] = savedPosition
-- Set character transparency
setCharacterTransparency([Link], 0.5)
-- Update button appearance
toggleButton.BackgroundColor3 = CONFIG.SUCCESS_COLOR
[Link] = "VISIBLE"
if _G.statusLabel then
_G.[Link] = "Invisible Mode Active"
_G.statusLabel.TextColor3 = CONFIG.SUCCESS_COLOR
end
createNotification("Invisibility ON", "You are now invisible")
else
-- Remove invisible chair
local invisChair = workspace:FindFirstChild("invischair")
if invisChair then
invisChair:Destroy()
end
-- Restore character visibility
if [Link] then
setCharacterTransparency([Link], 0)
end
-- Update button appearance
toggleButton.BackgroundColor3 = CONFIG.PRIMARY_COLOR
[Link] = "INVISIBLE"
if _G.statusLabel then
_G.[Link] = "Visible Mode Active"
_G.statusLabel.TextColor3 = CONFIG.SECONDARY_TEXT_COLOR
end
createNotification("Invisibility OFF", "You are now visible")
end
end
local function toggleSpeedBoost(): ()
local humanoid = getHumanoid()
if not humanoid then
warn("Humanoid not found")
return
end
[Link] = not [Link]
playSound()
if [Link] then
[Link] = CONFIG.BOOSTED_SPEED
speedButton.BackgroundColor3 = [Link](0, 255, 0)
[Link] = "SPEED ON"
createNotification("Speed Boost ON", `Speed: {CONFIG.BOOSTED_SPEED}`)
else
[Link] = [Link]
speedButton.BackgroundColor3 = [Link](255, 0, 0)
[Link] = "SPEED BOOST"
createNotification("Speed Boost OFF", `Speed:
{[Link]}`)
end
end
local function resetPlayerState(): ()
[Link] = false
[Link] = false
-- Reset button appearances
if toggleButton then
toggleButton.BackgroundColor3 = CONFIG.PRIMARY_COLOR
[Link] = "INVISIBLE"
end
if speedButton then
speedButton.BackgroundColor3 = CONFIG.DANGER_COLOR
[Link] = "SPEED BOOST"
end
-- Reset status
if _G.statusLabel then
_G.[Link] = "Ready"
_G.statusLabel.TextColor3 = CONFIG.SECONDARY_TEXT_COLOR
end
end
-- GUI Creation
local function createGUI(): ()
-- Main ScreenGui
screenGui = [Link]("ScreenGui")
[Link] = "InvisibilityGUI"
[Link] = false
[Link] = player:WaitForChild("PlayerGui")
-- Main Frame
mainFrame = [Link]("Frame")
[Link] = "MainFrame"
[Link] = [Link](0, 160, 0, 180)
[Link] = [Link](0.5, -80, 0.5, -90)
mainFrame.BackgroundColor3 = CONFIG.BACKGROUND_COLOR
[Link] = 0
[Link] = true
[Link] = true
[Link] = screenGui
-- Add corner rounding and shadow effect
local corner = [Link]("UICorner")
[Link] = [Link](0, 12)
[Link] = mainFrame
-- Add stroke for better definition
local stroke = [Link]("UIStroke")
[Link] = CONFIG.ACCENT_COLOR
[Link] = 2
[Link] = mainFrame
-- Title Label
local titleLabel = [Link]("TextLabel")
[Link] = "TitleLabel"
[Link] = [Link](1, -20, 0, 25)
[Link] = [Link](0, 10, 0, 10)
[Link] = "INVISIBILITY TOOL"
[Link] = 1
titleLabel.TextColor3 = CONFIG.TEXT_COLOR
[Link] = [Link]
[Link] = 12
[Link] = [Link]
[Link] = mainFrame
-- Toggle Button
toggleButton = [Link]("TextButton")
[Link] = "ToggleButton"
[Link] = [Link](1, -20, 0, 35)
[Link] = [Link](0, 10, 0, 45)
[Link] = "INVISIBLE"
toggleButton.BackgroundColor3 = CONFIG.PRIMARY_COLOR
toggleButton.TextColor3 = CONFIG.TEXT_COLOR
[Link] = [Link]
[Link] = true
[Link] = 0
[Link] = mainFrame
local toggleCorner = [Link]("UICorner")
[Link] = [Link](0, 8)
[Link] = toggleButton
-- Add hover effect for toggle button
local toggleStroke = [Link]("UIStroke")
[Link] = [Link](255, 255, 255)
[Link] = 0
[Link] = 0.8
[Link] = toggleButton
-- Speed Button
speedButton = [Link]("TextButton")
[Link] = "SpeedButton"
[Link] = [Link](1, -20, 0, 35)
[Link] = [Link](0, 10, 0, 90)
[Link] = "SPEED BOOST"
speedButton.BackgroundColor3 = CONFIG.DANGER_COLOR
speedButton.TextColor3 = CONFIG.TEXT_COLOR
[Link] = [Link]
[Link] = true
[Link] = 0
[Link] = mainFrame
local speedCorner = [Link]("UICorner")
[Link] = [Link](0, 8)
[Link] = speedButton
-- Add hover effect for speed button
local speedStroke = [Link]("UIStroke")
[Link] = [Link](255, 255, 255)
[Link] = 0
[Link] = 0.8
[Link] = speedButton
-- Close Button
closeButton = [Link]("TextButton")
[Link] = "CloseButton"
[Link] = [Link](0, 25, 0, 25)
[Link] = [Link](1, -30, 0, 5)
[Link] = "×"
closeButton.BackgroundColor3 = CONFIG.DANGER_COLOR
closeButton.TextColor3 = CONFIG.TEXT_COLOR
[Link] = [Link]
[Link] = 16
[Link] = 0
[Link] = mainFrame
local closeCorner = [Link]("UICorner")
[Link] = [Link](0, 6)
[Link] = closeButton
-- Status Indicator
local statusFrame = [Link]("Frame")
[Link] = "StatusFrame"
[Link] = [Link](1, -20, 0, 20)
[Link] = [Link](0, 10, 0, 135)
statusFrame.BackgroundColor3 = CONFIG.ACCENT_COLOR
[Link] = 0
[Link] = mainFrame
local statusCorner = [Link]("UICorner")
[Link] = [Link](0, 6)
[Link] = statusFrame
local statusLabel = [Link]("TextLabel")
[Link] = "StatusLabel"
[Link] = [Link](1, -10, 1, 0)
[Link] = [Link](0, 5, 0, 0)
[Link] = "Ready"
[Link] = 1
statusLabel.TextColor3 = CONFIG.SECONDARY_TEXT_COLOR
[Link] = [Link]
[Link] = 10
[Link] = [Link]
[Link] = statusFrame
-- Signature Label
signatureLabel = [Link]("TextLabel")
[Link] = "SignatureLabel"
[Link] = [Link](1, -20, 0, 15)
[Link] = [Link](0, 10, 1, -20)
[Link] = "By: xXHaNdEROXx TG@MK14CFG"
[Link] = 1
signatureLabel.TextColor3 = CONFIG.SECONDARY_TEXT_COLOR
[Link] = [Link]
[Link] = 8
[Link] = 0.5
[Link] = [Link]
[Link] = mainFrame
-- Sound
sound = [Link]("Sound")
[Link] = "ToggleSound"
[Link] = CONFIG.SOUND_ID
[Link] = 0.5
[Link] = screenGui
-- Store status label for updates
_G.statusLabel = statusLabel
end
-- Event Connections
local function connectEvents(): ()
-- Button connections
toggleButton.MouseButton1Click:Connect(toggleInvisibility)
speedButton.MouseButton1Click:Connect(toggleSpeedBoost)
closeButton.MouseButton1Click:Connect(function()
[Link] = false
end)
-- Keyboard input
[Link]:Connect(function(input: InputObject,
gameProcessed: boolean)
if gameProcessed then
return
end
if [Link] == CONFIG.TOGGLE_KEY then
toggleInvisibility()
end
end)
-- Character respawn handling
[Link]:Connect(function(character: Model)
resetPlayerState()
local humanoid = character:WaitForChild("Humanoid") :: Humanoid
[Link] = [Link]
[Link] = CONFIG.DEFAULT_SPEED
-- Clean up any existing invisible chairs
local invisChair = workspace:FindFirstChild("invischair")
if invisChair then
invisChair:Destroy()
end
end)
-- Handle player leaving
[Link]:Connect(function(leavingPlayer: Player)
if leavingPlayer == player then
local invisChair = workspace:FindFirstChild("invischair")
if invisChair then
invisChair:Destroy()
end
end
end)
end
-- Initialize
local function initialize(): ()
-- Wait for character to load
if not [Link] then
[Link]:Wait()
end
-- Store original speed
local humanoid = getHumanoid()
if humanoid then
[Link] = [Link]
end
-- Create GUI and connect events
createGUI()
connectEvents()
print("Enhanced Invisibility Script loaded successfully!")
end
-- Start the script
initialize()