Universal Script πŸ“Œ
102 Views
114 Executions

Follow command

Universal Script πŸ“Œ
foreverinaloop
foreverinaloopFirst script
5 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No 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

View Raw
-- 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

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
143
987
Bumped 28 minutes ago

Script hub

Lunyx Hub

Script hub
120.8k
221.2k
Bumped 47 minutes ago
Key System
Script hub
10.5k
200.6k
Bumped 1 hour ago

Script hub

KeylessVerified script badgeIRIDIUM HUB | #1

Script hub
33.3k
299.2k
Bumped 4 hours ago
Script hub
23.7k
5.3k
Bumped 4 hours ago
Key System
Paid
High QualityΒ Offering
Universal Script πŸ“Œ
305
977
Bumped 5 hours ago