local function Clone(Player, Character)
if game.Workspace:FindFirstChild(Character.Name) then
Character.Archivable = true
local NewCharacter = game.Workspace:FindFirstChild(Character.Name):Clone()
local PlayerRoot = Character:FindFirstChild("HumanoidRootPart") or Character:FindFirstChild("Torso")
local RootPart = NewCharacter:FindFirstChild("HumanoidRootPart") or NewCharacter:FindFirstChild("Torso")
if NewCharacter.PrimaryPart and PlayerRoot then
local SpawnOffset = Vector3.new(5, 0, 5)
NewCharacter:SetPrimaryPartCFrame(PlayerRoot.CFrame + SpawnOffset)
end
Character.Archivable = false
NewCharacter.Name = "Mirage_"..Character.Name.."_Clone"
NewCharacter.Parent = workspace
for _, v in ipairs(NewCharacter:GetDescendants()) do
if v:IsA("Accessory") then
if v.Name == "hand stick" then
v:Destroy()
end
if v.Name == "Background" then
v:Destroy()
end
if v.Name == "mirage effect" then
v:Destroy()
end
if v.Name == "flute" then
v.Handle["FLUTE FOX"].Transparency = 0
end
end
end
Player["PlayerGui"]["MirageGui"]["Mirage"]["Visible"] = true
Player["PlayerGui"]["MirageGui"]["Mirage"].MouseButton1Click:Connect(function()
local bSwap = false
if not bSwap then
if not bSwap then
bSwap = true
--Switch to new character without destroying the old Character
else
bSwap = false
--Switch back to the old character
end
end)
end
end