HypnotizeNpcs
Key RequiredUniversal

HypnotizeNpcs

Universal Scriptvincent009vincent009 102.7K views 233 executesUpdated Apr 26, 2025
5.0/ 5(4 votes)
40100% Positive
Lua Script•226 lines (6327 chars)
--add us on roblox vincentplayz9356
local player = game:GetService("Players").LocalPlayer
local SoundService = game:GetService("SoundService")
local Players = game:GetService("Players")

local startupSound = Instance.new("Sound")
startupSound.SoundId = "rbxassetid://446961725"
startupSound.Volume = 0.7
startupSound.Looped = false
startupSound.Parent = player:WaitForChild("PlayerGui")
startupSound:Play()

local focusSound = Instance.new("Sound")
focusSound.SoundId = "rbxassetid://6938611595"
focusSound.Volume = 0.7

local hypnotizedSound = Instance.new("Sound")
hypnotizedSound.SoundId = "rbxassetid://6938611571"
hypnotizedSound.Volume = 0.7

local deathSound = Instance.new("Sound")
deathSound.SoundId = "rbxassetid://623904185"
deathSound.Volume = 0.7
deathSound.Looped = false

local function createGUI()
	local gui = Instance.new("ScreenGui")
	gui.Name = "NPCToggleGUI"
	gui.ResetOnSpawn = false
	gui.Parent = player:WaitForChild("PlayerGui")

	local toggleButton = Instance.new("TextButton")
	toggleButton.Name = "ToggleButton"
	toggleButton.Size = UDim2.new(0, 150, 0, 50)
	toggleButton.Position = UDim2.new(0.5, -75, 0, 10)
	toggleButton.AnchorPoint = Vector2.new(0.5, 0)
	toggleButton.Text = "Focus 😤"
	toggleButton.BackgroundColor3 = Color3.fromRGB(100, 0, 0)
	toggleButton.TextColor3 = Color3.fromRGB(180, 180, 0)
	toggleButton.Font = Enum.Font.SourceSansBold
	toggleButton.TextSize = 20
	toggleButton.Parent = gui

	focusSound.Parent = toggleButton
	hypnotizedSound.Parent = toggleButton
	deathSound.Parent = toggleButton

	local UserInputService = game:GetService("UserInputService")
	local dragging
	local dragInput
	local dragStart
	local startPos

	local function update(input)
		local delta = input.Position - dragStart
		toggleButton.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
	end

	toggleButton.InputBegan:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
			dragging = true
			dragStart = input.Position
			startPos = toggleButton.Position

			input.Changed:Connect(function()
				if input.UserInputState == Enum.UserInputState.End then
					dragging = false
				end
			end)
		end
	end)

	toggleButton.InputChanged:Connect(function(input)
		if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
			dragInput = input
		end
	end)

	UserInputService.InputChanged:Connect(function(input)
		if input == dragInput and dragging then
			update(input)
		end
	end)

	return toggleButton
end

local scriptActive = false
local npcfollowloop = true
local toggleButton = createGUI()

local function setCanTouchValues()
	for _, obj in pairs(workspace:GetDescendants()) do
		if obj:IsA("BasePart") then
			if obj.Anchored then
				obj.CanTouch = true
			else
				local model = obj:FindFirstAncestorOfClass("Model")
				if model and model:FindFirstChildOfClass("Humanoid") and not game.Players:GetPlayerFromCharacter(model) then
					obj.CanTouch = false
				end
			end
		end
	end
end

local function setupPlayerDeathTracking()
	local function onCharacterAdded(character)
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.Died:Connect(function()
			deathSound:Play()
		end)
	end

	for _, player in pairs(Players:GetPlayers()) do
		if player.Character then
			onCharacterAdded(player.Character)
		end
		player.CharacterAdded:Connect(onCharacterAdded)
	end

	Players.PlayerAdded:Connect(function(player)
		player.CharacterAdded:Connect(onCharacterAdded)
	end)
end

setupPlayerDeathTracking()

toggleButton.MouseButton1Click:Connect(function()
	scriptActive = not scriptActive

	if scriptActive then
		hypnotizedSound:Play()
		toggleButton.Text = "Hypnotized 😵"
		toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 100)
		toggleButton.TextColor3 = Color3.fromRGB(180, 0, 180)
		setCanTouchValues()
	else
		focusSound:Play()
		toggleButton.Text = "Focus 😤"
		toggleButton.BackgroundColor3 = Color3.fromRGB(100, 0, 0)
		toggleButton.TextColor3 = Color3.fromRGB(180, 180, 0)
		setCanTouchValues()
	end
end)

spawn(function()
	while true do
		setCanTouchValues()
		task.wait(0.1)
	end
end)

-- 🧠 NEW FEATURE: auto NPC walk speed based on remaining players
local function updateNPCSpeedBasedOnPlayers()
	local totalPlayers = #Players:GetPlayers()
	local newSpeed = (totalPlayers <= 1) and 0 or 1000

	for _, descendant in pairs(workspace:GetDescendants()) do
		if descendant:IsA("Humanoid") and not Players:GetPlayerFromCharacter(descendant.Parent) then
			descendant.WalkSpeed = newSpeed
		end
	end
end

Players.PlayerAdded:Connect(updateNPCSpeedBasedOnPlayers)
Players.PlayerRemoving:Connect(updateNPCSpeedBasedOnPlayers)

spawn(function()
	while true do
		updateNPCSpeedBasedOnPlayers()
		task.wait(1)
	end
end)

while npcfollowloop do
	if scriptActive then
		local npcs = {}
		local OrgDestroyHeight = -500

		local function getAlivePlayers()
			local alivePlayers = {}
			for _, p in pairs(Players:GetPlayers()) do
				if p ~= player and p.Character and p.Character:FindFirstChild("Humanoid") and p.Character.Humanoid.Health > 0 then
					table.insert(alivePlayers, p)
				end
			end
			return alivePlayers
		end

		local function followRandomPlayer(hum)
			if hum:IsA("Humanoid") and not Players:GetPlayerFromCharacter(hum.Parent) then
				table.insert(npcs, {hum, hum.HipHeight})
				local npcModel = hum.Parent
				local npcRoot = npcModel:FindFirstChild("HumanoidRootPart")

				hum.JumpPower = 0
				for _, part in ipairs(npcModel:GetDescendants()) do
					if part:IsA("BasePart") then
						part.CanCollide = false
					end
				end

				local alivePlayers = getAlivePlayers()
				if #alivePlayers > 0 then
					local randomPlayer = alivePlayers[math.random(1, #alivePlayers)]
					if randomPlayer and randomPlayer.Character then
						local targetRoot = randomPlayer.Character:FindFirstChild("HumanoidRootPart")
						if targetRoot then
							hum:MoveTo(targetRoot.Position)
						end
					end
				end

				if npcRoot and npcRoot.Position.Y <= OrgDestroyHeight + 25 then
					npcRoot.Velocity = npcRoot.Velocity + Vector3.new(0, 250, 0)
				end
			end
		end

		for _, hum in pairs(workspace:GetDescendants()) do
			followRandomPlayer(hum)
		end
	end
	task.wait(0.01)
end

Features & Information

I added jojo stand in roblox now you can troll hangouters by punching their face and set them to sleep. *snoring* The Passive Ability Of The Script Is Stunning NPCs For The Single Player
#NPCs#controlnpcs#troll#Best script#Most favorite script

Community Comments (2)

juanbaylor60juanbaylor60Sep 6, 2025

Fake ahh script, doesn't do anything to npcs

ScriptgoonerScriptgoonerDec 31, 2025

doesnt work i expected a stand but it js shows 2 uis focus and hypnotised idk what it does

More Scripts for Universal Scripts