Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Place this script in a LocalScript
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local userInputService = game:GetService("UserInputService")
- local runService = game:GetService("RunService")
- local tweenService = game:GetService("TweenService")
- local cooldown = false
- local cooldownTime = 6 -- Cooldown duration in seconds
- local frozenPlayers = {}
- -- Print welcome messages
- print("Welcome to Client Dio V1!! I had so much fun making this.")
- print("F to stop time")
- print("J to summon stand (not finished)")
- -- Send a notification to the player
- game:GetService("StarterGui"):SetCore("SendNotification", {
- Title = "HEY!", -- Required
- Text = "check console for stuff!", -- Required
- Icon = "rbxassetid://1234567890" -- Optional
- })
- -- Function to freeze a player
- local function freezePlayer(otherCharacter)
- if otherCharacter and otherCharacter:FindFirstChild("HumanoidRootPart") then
- otherCharacter.HumanoidRootPart.Anchored = true
- frozenPlayers[otherCharacter] = true
- end
- end
- -- Function to unfreeze a player
- local function unfreezePlayer(otherCharacter)
- if otherCharacter and otherCharacter:FindFirstChild("HumanoidRootPart") then
- otherCharacter.HumanoidRootPart.Anchored = false
- frozenPlayers[otherCharacter] = nil
- end
- end
- -- Function to check if a player's camera is inside the domain
- local function isCameraInDomain(domain)
- local camera = workspace.CurrentCamera
- local distance = (camera.CFrame.Position - domain.Position).Magnitude
- return distance <= domain.Size.X / 2
- end
- -- Function to apply black and white vision
- local function applyBlackAndWhiteVision()
- if not workspace.CurrentCamera:FindFirstChild("BlackAndWhiteEffect") then
- local colorCorrection = Instance.new("ColorCorrectionEffect")
- colorCorrection.Name = "BlackAndWhiteEffect"
- colorCorrection.Saturation = -1
- colorCorrection.Contrast = 0.5
- colorCorrection.Parent = workspace.CurrentCamera
- end
- end
- -- Function to remove black and white vision
- local function removeBlackAndWhiteVision()
- if workspace.CurrentCamera:FindFirstChild("BlackAndWhiteEffect") then
- workspace.CurrentCamera:FindFirstChild("BlackAndWhiteEffect"):Destroy()
- end
- end
- -- Function to monitor camera position and apply/remove vision effect
- local function monitorCamera(domain)
- local connection
- connection = runService.RenderStepped:Connect(function()
- if domain and domain.Parent then
- if isCameraInDomain(domain) then
- applyBlackAndWhiteVision()
- else
- removeBlackAndWhiteVision()
- end
- else
- connection:Disconnect()
- removeBlackAndWhiteVision() -- Ensure the effect is removed when the domain is gone
- end
- end)
- end
- -- Function to create the domain
- local function createDomain()
- if cooldown then return end
- cooldown = true
- -- Create the domain part
- local domain = Instance.new("Part")
- domain.Size = Vector3.new(26, 26, 26) -- Make the domain 1.3x larger
- domain.Shape = Enum.PartType.Ball -- Set the shape to a sphere (circle)
- domain.Material = Enum.Material.Glass -- Set material to Glass
- domain.Transparency = 0.5 -- Adjust transparency to make it more glass-like
- domain.Anchored = false
- domain.CanCollide = false
- domain.CastShadow = false -- Disable shadows for the domain
- domain.Parent = workspace
- domain.CFrame = character.HumanoidRootPart.CFrame -- Position it at the player
- -- Attach the domain to the player
- local attachment0 = Instance.new("Attachment", domain)
- local attachment1 = Instance.new("Attachment", character.HumanoidRootPart)
- local rigidConstraint = Instance.new("RigidConstraint")
- rigidConstraint.Attachment0 = attachment0
- rigidConstraint.Attachment1 = attachment1
- rigidConstraint.Parent = domain
- -- Play the sound when F is pressed
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://7514417921"
- sound.Volume = 0.5
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Freeze other players inside the domain
- domain.Touched:Connect(function(hit)
- local otherCharacter = hit.Parent
- if otherCharacter and otherCharacter:FindFirstChild("HumanoidRootPart") then
- local otherPlayer = game.Players:GetPlayerFromCharacter(otherCharacter)
- if otherPlayer and otherPlayer ~= player then
- freezePlayer(otherCharacter)
- end
- end
- end)
- -- Monitor camera position for vision effect
- monitorCamera(domain)
- -- Destroy the domain and unfreeze players after 6 seconds
- game:GetService("Debris"):AddItem(domain, 6)
- wait(6)
- for otherCharacter, _ in pairs(frozenPlayers) do
- unfreezePlayer(otherCharacter)
- end
- -- Remove vision effect when domain is gone
- removeBlackAndWhiteVision()
- -- Cooldown
- wait(cooldownTime)
- cooldown = false
- end
- -- Function to summon fog and play sound when J is pressed
- local function summonFog()
- -- Create the ParticleEmitter for fog
- local fogEmitter = Instance.new("ParticleEmitter")
- fogEmitter.Texture = "rbxasset://textures/particles/smoke_main.dds" -- Use a smoke texture for fog
- fogEmitter.Color = ColorSequence.new(Color3.fromRGB(105, 105, 105)) -- Adjust color as needed
- fogEmitter.LightInfluence = 0
- fogEmitter.Size = NumberSequence.new(3) -- Size of the particles (smaller size)
- fogEmitter.Lifetime = NumberRange.new(5) -- How long each particle lasts
- fogEmitter.Rate = 50 -- How many particles are emitted per second
- fogEmitter.Speed = NumberRange.new(0.5) -- Speed of the particles
- fogEmitter.Rotation = NumberRange.new(0, 360)
- fogEmitter.RotSpeed = NumberRange.new(10)
- fogEmitter.SpreadAngle = Vector2.new(360, 360)
- fogEmitter.Parent = character.HumanoidRootPart -- Attach the emitter to the character
- -- Play the sound and remove the fog when the sound finishes
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://6921086445"
- sound.Volume = 0.5
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- sound.Ended:Connect(function()
- -- Destroy the ParticleEmitter
- fogEmitter:Destroy()
- end)
- end
- -- Function to create and weld a new avatar to the player
- local function createAndWeldAvatar()
- -- Clone the player's character
- local newAvatar = character:Clone()
- newAvatar.Parent = workspace
- -- Position the new avatar to the side of the player
- local offset = Vector3.new(5, 0, 0) -- Adjust the offset to position it to the side
- newAvatar:SetPrimaryPartCFrame(character.HumanoidRootPart.CFrame * CFrame.new(offset))
- -- Weld the new avatar to the player's character
- for _, part in pairs(newAvatar:GetChildren()) do
- if part:IsA("BasePart") then
- local weld = Instance.new("WeldConstraint")
- weld.Part0 = part
- weld.Part1 = character:FindFirstChild(part.Name)
- weld.Parent = part
- end
- end
- -- Ensure the new avatar is anchored to the player
- local attachment0 = Instance.new("Attachment", newAvatar.HumanoidRootPart)
- local attachment1 = Instance.new("Attachment", character.HumanoidRootPart)
- local rigidConstraint = Instance.new("RigidConstraint")
- rigidConstraint.Attachment0 = attachment0
- rigidConstraint.Attachment1 = attachment1
- rigidConstraint.Parent = newAvatar.HumanoidRootPart
- end
- -- Function to detect key press
- userInputService.InputBegan:Connect(function(input, gameProcessed)
- if not gameProcessed and input.KeyCode == Enum.KeyCode.F then
- createDomain()
- elseif not gameProcessed and input.KeyCode == Enum.KeyCode.J then
- summonFog()
- createAndWeldAvatar()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement