
81 Views
78 Executions
Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
i made this with ai please don't be made at me im new too this stuff :C
-- Ultra-Smart Hybrid Follower (With "NUH UH" Ground Recovery Command)
local Players = game:GetService("Players")
local PathfindingService = game:GetService("PathfindingService")
local RunService = game:GetService("RunService")
local localPlayer = Players.LocalPlayer
local targetPlayer = nil
local followConnection = nil
local bodyVelocity = nil
local bodyGyro = nil
-- Configuration
local STUCK_TIME_LIMIT = 0.4
local AIR_THRESHOLD = 5
local path = PathfindingService:CreatePath({
AgentRadius = 1.5,
AgentHeight = 4.5,
AgentCanJump = false,
AgentSlope = 45
})
local function removeFlightForces()
if bodyVelocity then bodyVelocity:Destroy(); bodyVelocity = nil end
if bodyGyro then bodyGyro:Destroy(); bodyGyro = nil end
end
-- Safely finds the closest solid ground surface underneath the character
local function teleportToNearestGround(rootPart)
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {rootPart.Parent}
-- Cast a long ray straight down (up to 500 studs) to find a floor
local raycastResult = workspace:Raycast(rootPart.Position, Vector3.new(0, -500, 0), raycastParams)
if raycastResult then
-- Snap to the intersection position + a minor upward offset so your feet don't clip into the floor
rootPart.CFrame = CFrame.new(raycastResult.Position + Vector3.new(0, 3, 0))
end
Comments
0Log in to join the conversation. Login
No comments yet. Be the first!








