-- Improved Avatar Swap Exploit by Rex
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local StarterGui = game:GetService("StarterGui")
-- Create GUI
local function createGUI()
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "AvatarSwapGUI"
ScreenGui.Parent = game:GetService("CoreGui")
local Frame = Instance.new("Frame")
Frame.Size = UDim2.new(0, 250, 0, 150)
Frame.Position = UDim2.new(0.5, -125, 0.5, -75)
Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
Frame.BorderSizePixel = 2
Frame.Active = true
Frame.Draggable = true
Frame.Parent = ScreenGui
local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, 0, 0, 30)
Title.Text = "Avatar Swap by Rex"
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
Title.TextScaled = true
Title.Parent = Frame
local InputBox = Instance.new("TextBox")
InputBox.Size = UDim2.new(0.8, 0, 0, 30)
InputBox.Position = UDim2.new(0.1, 0, 0.3, 0)
InputBox.Text = "Enter Username or User ID"
InputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
InputBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
InputBox.TextScaled = true
InputBox.ClearTextOnFocus = true
InputBox.Parent = Frame
local Button = Instance.new("TextButton")
Button.Size = UDim2.new(0.8, 0, 0, 30)
Button.Position = UDim2.new(0.1, 0, 0.6, 0)
Button.Text = "Swap Avatar"
Button.TextColor3 = Color3.fromRGB(255, 255, 255)
Button.BackgroundColor3 = Color3.fromRGB(0, 120, 0)
Button.TextScaled = true
Button.Parent = Frame
return InputBox, Button
end
-- Function to swap avatar
local function swapAvatar(input)
local userId
-- Convert input to User ID
if tonumber(input) then
userId = tonumber(input)
else
pcall(function()
userId = Players:GetUserIdFromNameAsync(input)
end)
end
if not userId then
StarterGui:SetCore("SendNotification", {
Title = "Error",
Text = "Invalid Username or User ID",
Duration = 3
})
return
end
-- Fetch character appearance
local success, appearance = pcall(function()
return Players:GetCharacterAppearanceAsync(userId)
end)
if not success or not appearance then
StarterGui:SetCore("SendNotification", {
Title = "Error",
Text = "Failed to fetch avatar",
Duration = 3
})
return
end
-- Apply appearance to local character
local character = LocalPlayer.Character
if not character then
StarterGui:SetCore("SendNotification", {
Title = "Error",
Text = "No character found",
Duration = 3
})
return
end
-- Clear current appearance
for _, obj in pairs(character:GetChildren()) do
if obj:IsA("Accessory") or obj:IsA("Shirt") or obj:IsA("Pants") or
obj:IsA("ShirtGraphic") or obj:IsA("BodyColors") or
obj:IsA("CharacterMesh") or obj:IsA("SpecialMesh") then
pcall(function()
obj:Destroy()
end)
end
end
-- Apply new appearance
for _, item in pairs(appearance:GetChildren()) do
pcall(function()
if item:IsA("Shirt") or item:IsA("Pants") or item:IsA("ShirtGraphic")
or
item:IsA("BodyColors") then
local clonedItem = item:Clone()
clonedItem.Parent = character
elseif item:IsA("Accessory") then
-- Handle all accessory types
local clonedAccessory = item:Clone()
character.Humanoid:AddAccessory(clonedAccessory)
elseif item:IsA("CharacterMesh") then
-- Handle body part meshes (e.g., headless)
local clonedMesh = item:Clone()
clonedMesh.Parent = character
end
end)
end
-- Handle headless specifically
local head = character:FindFirstChild("Head")
if head then
-- Check if target has headless (simplified check)
local hasHeadless = false
pcall(function()
local humanoidDesc = Players:GetHumanoidDescriptionFromUserId(userId)
if humanoidDesc.HeadScale == 0 or not appearance:FindFirstChild("Head")
then
hasHeadless = true
end
end)
if hasHeadless then
head.Transparency = 1 -- Hide head
local face = head:FindFirstChild("face")
if face then
face.Transparency = 1
end
else
head.Transparency = 0 -- Restore head
local face = head:FindFirstChild("face")
if face then
face.Transparency = 0
end
end
end
StarterGui:SetCore("SendNotification", {
Title = "Success",
Text = "Avatar swapped to User ID: " .. userId,
Duration = 3
})
end
-- Main execution
local InputBox, Button = createGUI()
Button.MouseButton1Click:Connect(function()
pcall(function()
swapAvatar(InputBox.Text)
end)
end)
-- Anti-detection: Randomize checks
while true do
pcall(function()
if not game:GetService("CoreGui"):FindFirstChild("AvatarSwapGUI") then
createGUI() -- Recreate GUI if destroyed
end
end)
wait(math.random(1, 3)) -- Random wait to avoid anti-cheat
end