Certainly! Below is an advanced Roblox script that creates the illusion where your character is a fake character and everything around you is an illusion. This script achieves the following:
- Clones your character to create a fake version that's visible but not controllable.
- Overlays visual effects to make the environment appear distorted and illusory.
- Hijacks camera controls to maintain the illusion.
- Disables player input to prevent interaction with the real character.
- Adds environmental animations to enhance the sense of illusion.
Instructions:
- Place this script in a LocalScript inside StarterPlayerScripts.
--[[
Illusion Script
Place this script in StarterPlayerScripts as a LocalScript
--]]
-- Services
local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
-- Variables
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
-- Wait until character is loaded
local function getCharacter()
if player.Character then
return player.Character
end
return player.CharacterAdded:Wait()
end
local character = getCharacter()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")
-- Clone the character to create a fake
local fakeCharacter = character:Clone()
fakeCharacter.Name = "FakeCharacter"
-- Remove scripts from the fake character
for _, descendant in ipairs(fakeCharacter:GetDescendants()) do
if descendant:IsA("Script") or descendant:IsA("LocalScript") then
descendant:Destroy()
end
end
-- Position the fake character
fakeCharacter:SetPrimaryPartCFrame(rootPart.CFrame)
fakeCharacter.Parent = workspace
-- Make the real character invisible
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("Decal") or part:IsA("MeshPart") then
part.Transparency = 1
if part:IsA("BasePart") then
part.CanCollide = false
end
elseif part:IsA("ParticleEmitter") or part:IsA("Trail") then
part.Enabled = false
elseif part:IsA("BillboardGui") or part:IsA("SurfaceGui") then
part.Enabled = false
end
end
humanoid.RootPart.Anchored = true
-- Disable controls
local Controls = require(player.PlayerScripts:WaitForChild("PlayerModule")):GetControls()
Controls:Disable()
-- Hijack the camera
camera.CameraType = Enum.CameraType.Scriptable
-- Create visual effects
-- Blur
local blurEffect = Instance.new("BlurEffect")
blurEffect.Size = 0
blurEffect.Parent = Lighting
-- Color Correction
local colorEffect = Instance.new("ColorCorrectionEffect")
colorEffect.Brightness = 0
colorEffect.Contrast = 0
colorEffect.Saturation = 0
colorEffect.TintColor = Color3.new(1, 1, 1)
colorEffect.Parent = Lighting
-- Bloom
local bloomEffect = Instance.new("BloomEffect")
bloomEffect.Intensity = 0
bloomEffect.Size = 24
bloomEffect.Threshold = 1
bloomEffect.Parent = Lighting
-- Distort the environment
local distortAmount = 0
-- Animate visual effects
local function animateEffects()
-- Blur animation
TweenService:Create(blurEffect, TweenInfo.new(2), {Size = 10}):Play()
-- Color animation
TweenService:Create(colorEffect, TweenInfo.new(2), {
Saturation = -0.5,
Contrast = 0.1,
TintColor = Color3.fromRGB(200, 200, 255)
}):Play()
-- Bloom animation
TweenService:Create(bloomEffect, TweenInfo.new(2), {Intensity = 1.5}):Play()
-- Increase distortion
distortAmount = 0.1
end
-- Start visual effects animation
animateEffects()
-- Wobble variables
local wobbleSpeed = 2
local wobbleIntensity = 0.2
-- Render loop
RunService.RenderStepped:Connect(function(deltaTime)
-- Camera wobble effect
local time = tick() * wobbleSpeed
local wobbleOffset = Vector3.new(
math.sin(time) * wobbleIntensity,
math.cos(time * 0.75) * wobbleIntensity,
0
)
local fakeRoot = fakeCharacter:FindFirstChild("HumanoidRootPart")
if fakeRoot then
camera.CFrame = CFrame.new(fakeRoot.Position + wobbleOffset, fakeRoot.Position + fakeRoot.CFrame.LookVector * 10)
end
-- Environment distortion
if distortAmount > 0 then
for _, part in ipairs(workspace:GetDescendants()) do
if part:IsA("BasePart") and part ~= fakeRoot and not part:IsDescendantOf(fakeCharacter) then
local originalCFrame = part:GetAttribute("OriginalCFrame")
if not originalCFrame then
part:SetAttribute("OriginalCFrame", part.CFrame)
originalCFrame = part.CFrame
end
local offset = Vector3.new(
math.noise(part.Position.X, tick()) * distortAmount,
math.noise(part.Position.Y, tick()) * distortAmount,
math.noise(part.Position.Z, tick()) * distortAmount
)
part.CFrame = originalCFrame:ToObjectSpace(CFrame.new(offset)) * part.CFrame
end
end
end
end)
-- OPTIONAL: Fade out the fake character over time
local function fadeOutFakeCharacter()
for transparency = 0, 1, 0.01 do
for _, part in ipairs(fakeCharacter:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("Decal") or part:IsA("MeshPart") then
part.Transparency = transparency
elseif part:IsA("ParticleEmitter") or part:IsA("Trail") then
part.Transparency = NumberSequence.new(transparency)
end
end
wait(0.1)
end
fakeCharacter:Destroy()
end
-- Start fade out after a delay
delay(10, fadeOutFakeCharacter)
Explanation:
Notes:
Disclaimer:
- Use this script responsibly.
- Ensure that it complies with Roblox's terms of service and community guidelines.
- Be mindful of the player experience; sudden or disorienting effects might not be suitable for all audiences.
Feel free to ask if you need further assistance or modifications to the script!