Bot
Key RequiredUniversal

Bot

Universal Scriptskibidimariodisneyskibidimariodisney 3.3K views 102 executesUpdated May 9, 2025
Unrated
00
Lua Script•97 lines (2603 chars)
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local model = Instance.new("Model")
model.Name = "Bot"

local root = Instance.new("Part")
root.Size = Vector3.new(1, 1, 1)
root.Position = character.HumanoidRootPart.Position + Vector3.new(0, 3, 0)
root.Anchored = false
root.CanCollide = true
root.Name = "HumanoidRootPart"
root.Parent = model

local head = Instance.new("Part")
head.Size = Vector3.new(1, 1, 1)
head.Position = root.Position + Vector3.new(0, 1, 0)
head.Anchored = false
head.CanCollide = true
head.Name = "Head"
head.Parent = model

local weld = Instance.new("WeldConstraint")
weld.Part0 = root
weld.Part1 = head
weld.Parent = root

local botHumanoid = Instance.new("Humanoid")
botHumanoid.HipHeight = 1.5
botHumanoid.WalkSpeed = 10
botHumanoid.Parent = model

model.PrimaryPart = root
model.Parent = workspace

local tool = Instance.new("Tool")
tool.RequiresHandle = false
tool.Name = "Target"
tool.Parent = player.Backpack

local waypoint = nil

tool.Activated:Connect(function()
	local mouse = player:GetMouse()
	if not mouse then return end

	local inputting = UIS:IsKeyDown(Enum.KeyCode.W) or UIS:IsKeyDown(Enum.KeyCode.A)
		or UIS:IsKeyDown(Enum.KeyCode.S) or UIS:IsKeyDown(Enum.KeyCode.D)
		or UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1)
		or UIS.TouchEnabled and UIS:GetMouseButtonsPressed()[1]
		or humanoid.MoveDirection.Magnitude > 0
		or humanoid:GetState() == Enum.HumanoidStateType.Jumping

	if inputting then return end

	local pos = mouse.Hit.Position

	if waypoint then
		waypoint:Destroy()
	end

	local wp = Instance.new("Part")
	wp.Anchored = true
	wp.CanCollide = false
	wp.Size = Vector3.new(1, 1, 1)
	wp.Shape = Enum.PartType.Block
	wp.Color = Color3.new(1, 0, 0)
	wp.Material = Enum.Material.Neon
	wp.Transparency = 0.2
	wp.Name = "Waypoint"
	wp.Position = Vector3.new(pos.X, pos.Y + 0.2, pos.Z)
	wp.Parent = workspace

	local circle = Instance.new("SpecialMesh")
	circle.MeshType = Enum.MeshType.FileMesh
	circle.MeshId = "rbxassetid://3270017"
	circle.Scale = Vector3.new(6, 6, 1)
	circle.Parent = wp

	waypoint = wp
end)

task.spawn(function()
	while model and botHumanoid and botHumanoid.Parent do
		if waypoint and waypoint.Parent then
			local dist = (root.Position - waypoint.Position).Magnitude
			if dist > 2 then
				botHumanoid:MoveTo(waypoint.Position)
			end
		end
		task.wait(0.2)
	end
end)

Features & Information

Bot that follows way points

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts