Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Debugging function to print messages
- local function debugPrint(message)
- print(message)
- end
- -- Function to create the Notification GUI
- local function createNotification()
- -- Create a new ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "NotificationGui"
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- debugPrint("Notification GUI created")
- -- Create a Frame for the notification
- local notificationFrame = Instance.new("Frame")
- notificationFrame.Size = UDim2.new(0.3, 0, 0.1, 0)
- notificationFrame.Position = UDim2.new(0.35, 0, 0.05, 0)
- notificationFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- notificationFrame.BorderSizePixel = 0
- notificationFrame.BackgroundTransparency = 0.7
- notificationFrame.Parent = screenGui
- debugPrint("Notification Frame created")
- -- Add a TextLabel for the notification message
- local notificationText = Instance.new("TextLabel")
- notificationText.Size = UDim2.new(1, 0, 1, 0)
- notificationText.Position = UDim2.new(0, 0, 0, 0)
- notificationText.BackgroundTransparency = 1
- notificationText.TextColor3 = Color3.fromRGB(255, 255, 255)
- notificationText.TextStrokeTransparency = 0.5
- notificationText.Text = "By d00kfe"
- notificationText.TextScaled = true
- notificationText.Parent = notificationFrame
- debugPrint("Notification TextLabel created")
- -- TweenService for animation
- local TweenService = game:GetService("TweenService")
- local tweenInfoIn = TweenInfo.new(0.7, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
- local tweenInfoOut = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
- local tweenIn = TweenService:Create(notificationFrame, tweenInfoIn, {Position = UDim2.new(0.35, 0, 0.05, 0), BackgroundTransparency = 0.7})
- local tweenOut = TweenService:Create(notificationFrame, tweenInfoOut, {Position = UDim2.new(0.35, 0, -0.2, 0), BackgroundTransparency = 1})
- -- Display the notification
- tweenIn:Play()
- wait(2)
- tweenOut:Play()
- -- Cleanup after tween completes
- tweenOut.Completed:Connect(function()
- screenGui:Destroy()
- debugPrint("Notification GUI destroyed")
- end)
- end
- -- Function to create the Player Hiding GUI
- local function createPlayerHidingGUI()
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- debugPrint("Player Hiding GUI created")
- -- Create draggable Frame for GUI
- local draggableFrame = Instance.new("Frame")
- draggableFrame.Size = UDim2.new(0, 200, 0, 200)
- draggableFrame.Position = UDim2.new(0.5, -100, 0.3, -100)
- draggableFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- draggableFrame.BorderSizePixel = 0
- draggableFrame.BackgroundTransparency = 0.7
- draggableFrame.Parent = screenGui
- debugPrint("Draggable Frame created")
- -- Add drag functionality
- local dragging, dragStart, startPos
- local function onInput(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = draggableFrame.Position
- end
- end
- local function onInputChange(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - dragStart
- draggableFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end
- local function onInputEnd(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end
- draggableFrame.InputBegan:Connect(onInput)
- draggableFrame.InputChanged:Connect(onInputChange)
- draggableFrame.InputEnded:Connect(onInputEnd)
- -- Create TextBox for username input
- local usernameInput = Instance.new("TextBox")
- usernameInput.Name = "UsernameInput"
- usernameInput.Size = UDim2.new(0, 200, 0, 50)
- usernameInput.Position = UDim2.new(0.5, -100, 0.3, 0)
- usernameInput.PlaceholderText = "Enter username here or 'all'"
- usernameInput.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- usernameInput.TextColor3 = Color3.fromRGB(255, 255, 255)
- usernameInput.Parent = draggableFrame
- debugPrint("UsernameInput TextBox created")
- -- Create TextButton for hiding player
- local hideButton = Instance.new("TextButton")
- hideButton.Name = "HideButton"
- hideButton.Size = UDim2.new(0, 200, 0, 50)
- hideButton.Position = UDim2.new(0.5, -100, 0.4, 0)
- hideButton.Text = "Hide Player(s)"
- hideButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- hideButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- hideButton.Parent = draggableFrame
- debugPrint("HideButton created")
- -- Create TextLabel for status messages
- local statusLabel = Instance.new("TextLabel")
- statusLabel.Name = "StatusLabel"
- statusLabel.Size = UDim2.new(0, 200, 0, 50)
- statusLabel.Position = UDim2.new(0.5, -100, 0.5, 0)
- statusLabel.Text = ""
- statusLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- statusLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- statusLabel.Parent = draggableFrame
- debugPrint("StatusLabel created")
- -- Function to hide all players
- local function hideAllPlayers()
- local players = Players:GetPlayers()
- for _, player in pairs(players) do
- if player ~= LocalPlayer and player.Character then
- local character = player.Character
- -- Hide all BaseParts of the character
- for _, part in pairs(character:GetChildren()) do
- if part:IsA("BasePart") then
- part.Transparency = 1
- part.CanCollide = false
- end
- end
- -- Hide the character's accessories
- for _, accessory in pairs(character:GetChildren()) do
- if accessory:IsA("Accessory") then
- local handle = accessory:FindFirstChild("Handle")
- if handle then
- handle.Transparency = 1
- end
- end
- end
- -- Hide the humanoid
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- end
- -- Hide player GUI elements
- local playerGui = player:FindFirstChildOfClass("PlayerGui")
- if playerGui then
- playerGui:Destroy()
- end
- end
- end
- -- Hide all chat messages
- local chatEvents = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
- if chatEvents then
- local function onMessageReceived(message)
- if message and message.Parent == chatEvents then
- message:Destroy()
- end
- end
- chatEvents.OnMessageReceived:Connect(onMessageReceived)
- end
- statusLabel.Text = "All players are now hidden from your view."
- debugPrint("All players hidden")
- end
- -- Function to hide a specific player
- local function hidePlayer(username)
- local playerToHide = Players:FindFirstChild(username)
- if playerToHide and playerToHide.Character then
- local character = playerToHide.Character
- -- Hide all BaseParts of the character
- for _, part in pairs(character:GetChildren()) do
- if part:IsA("BasePart") then
- part.Transparency = 1
- part.CanCollide = false
- end
- end
- -- Hide the character's accessories
- for _, accessory in pairs(character:GetChildren()) do
- if accessory:IsA("Accessory") then
- local handle = accessory:FindFirstChild("Handle")
- if handle then
- handle.Transparency = 1
- end
- end
- end
- -- Hide the humanoid
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- end
- -- Hide player GUI elements
- local playerGui = playerToHide:FindFirstChildOfClass("PlayerGui")
- if playerGui then
- playerGui:Destroy()
- end
- -- Hide messages from the specific player
- local chatEvents = ReplicatedStorage:FindFirstChild("DefaultChatSystemChatEvents")
- if chatEvents then
- local function onMessageReceived(message)
- if message and message.Parent == chatEvents then
- local messageSender = message:FindFirstChild("Sender")
- if messageSender and messageSender.Value == playerToHide then
- message:Destroy()
- end
- end
- end
- chatEvents.OnMessageReceived:Connect(onMessageReceived)
- end
- statusLabel.Text = username .. " is now hidden from your view."
- debugPrint(username .. " hidden")
- else
- statusLabel.Text = "Player not found or character not loaded."
- debugPrint("Player not found or character not loaded")
- end
- end
- -- Connect button click to function
- hideButton.MouseButton1Click:Connect(function()
- local username = usernameInput.Text
- if username == "all" then
- hideAllPlayers()
- else
- hidePlayer(username)
- end
- end)
- end
- -- Execute both functions
- createNotification()
- createPlayerHidingGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement