Gabz
Key RequiredUniversal

Gabz

Universal ScriptDizzilovellDizzilovell 5.1K views 98 executesUpdated Jul 21, 2025
Unrated
00
Lua Script•49 lines (1410 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- Find a random humanoid including other player characters, excluding the player's own character
local function getRandomHumanoid(excludeCharacter)
	local candidates = {}

	for _, model in pairs(workspace:GetChildren()) do
		if model:IsA("Model") and model ~= excludeCharacter then
			local humanoid = model:FindFirstChildOfClass("Humanoid")
			local hrp = model:FindFirstChild("HumanoidRootPart")
			if humanoid and hrp then
				table.insert(candidates, model)
			end
		end
	end

	if #candidates > 0 then
		return candidates[math.random(1, #candidates)]
	end

	return nil
end

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local hrp = character:WaitForChild("HumanoidRootPart")

		local targetModel = getRandomHumanoid(character)
		if not targetModel then
			warn("No humanoid found to follow.")
			return
		end

		local targetHRP = targetModel:FindFirstChild("HumanoidRootPart")
		if not targetHRP then
			warn("Target has no HumanoidRootPart.")
			return
		end

		-- Update the character's velocity every frame to follow the target
		RunService.Heartbeat:Connect(function()
			if character and hrp and targetHRP and targetModel.Parent then
				local direction = (targetHRP.Position - hrp.Position).Unit
				hrp.Velocity = direction * 10
			end
		end)
	end)
end)

Features & Information

Follows players and fe audio fly

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts