Run it
Copy the script and paste it into your executor.
local monster = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character
local hum = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
function findClosestPlayer()
local closestPlayer = nil
local closestDistance = math.huge
for i, v in ipairs(game.Players:GetPlayers()) do
if v ~= player then
local vChar = v.Character
if vChar then
local vRoot = vChar:WaitForChild("HumanoidRootPart")
local distance = (root.Position - vRoot.Position).Magnitude
if distance < closestDistance
closestPlayer = v
closestDistance = distance
closestPlayer
(playerToChase)
playerRoot = playerToChase.Character:()
targetDirection = (playerRoot.Position - root.Position).Unit
moveDirection = .(root.Position, root.Position + targetDirection) * .(, .(), )
monster:(moveDirection)
()
closestPlayer = ()
closestPlayer
(closestPlayer)
Uhsh

Universal