Universal Script 📌
7.9k Views
18 Executions

show trajectory

Universal Script 📌
hiff
hiffPublished 5
3 years 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

shows your trajectory like in the image, very useful i know. adjust the settings as your likings NOTE: This is a reupload due to the data rollback, you may have already seen this.

View Raw
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local trajectoryEnabled = false --T to toggle it
local trajectoryColor = Color3.fromRGB(255, 0, 0) 
local trajectoryThickness = 2 

local trajectoryPoints = {} -- Stores the trajectory points
local trajectoryParts = {} -- Stores the trajectory part instances


local function updateTrajectoryPoints()
    if trajectoryEnabled then
        table.insert(trajectoryPoints, humanoidRootPart.Position)
        if #trajectoryPoints > 100 then
            table.remove(trajectoryPoints, 1)
        end
    else
        trajectoryPoints = {}
    end
end


local function drawTrajectory()
    for i = 1, #trajectoryParts do
        trajectoryParts[i]:Destroy()
    end
    trajectoryParts = {}

    if trajectoryEnabled and #trajectoryPoints > 1 then
        for i = 1, #trajectoryPoints - 1 do
            local startPoint = trajectoryPoints[i]
            local endPoint = trajectoryPoints[i + 1]
            if startPoint and endPoint then
                local segment = Instance.new("Part")
                segment.Name = "TrajectorySegment"
                segment.BrickColor = BrickColor.new(trajectoryColor)
                segment.Size = Vector3.new(trajectoryThickness, trajectoryThickness, (endPoint - startPoint).Magnitude)


Comments

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

Tags

More universal scripts

See all
Script hub
272.4k
884.6k
Bumped 4 minutes ago
Key System

Script hub

#16 this week

Verified script badgeAxon Hub 60+ Games & 800+ Features

Script hub
30.1k
92.0k
Bumped 4 hours ago
Key System

Script hub

#2 this week

Verified script badgeArcane Hub | 125+ Games & 4000+ Features

Script hub
138.6k
417.6k
Bumped 5 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub | Easy Key System

Script hub
3.9M
964.8k
Bumped 5 hours ago

Script hub

Hall of Fame #3

KeylessVerified script badge[KEYLESS] Moondiety Script | 20+ supported Games

Universal Script 📌
1.1k
152
Bumped 6 hours ago
Key System
Script hub
524
10
Approved 7 hours ago
Key System
Paid