Run it
Copy the script and paste it into your executor.
-- // Credit : DownInDaNang
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = game:GetService("Players").LocalPlayer
local GetCupLocation = ReplicatedStorage:WaitForChild("Functions"):WaitForChild("GetCupLocationFunction")
local TargetCupPos: Vector3? = nil
local function UpdateHoleLocation(): ()
local CurrentHole: number = LocalPlayer:WaitForChild():().Value
HoleString: = .(, CurrentHole)
CourseModel: any = :()
CupPos: any, CupData: any = GetCupLocation:(HoleString, CourseModel CourseModel.Name )
(CupPos) ==
TargetCupPos = CupPos
LocalPlayer:():().Changed:(UpdateHoleLocation)
.(UpdateHoleLocation)
OldNewIndex: any
OldNewIndex = (, , (Self: any, Index: , Value: any): any
() (Index == Index == ) Self:() Self.Name:()
TargetCupPos
DeltaPos: = (TargetCupPos - Self.Position)
HorizontalDist: number = .(DeltaPos.X, , DeltaPos.Z).Magnitude
HorizontalDist >
TimeToTarget: number = .(HorizontalDist / , , )
Gravity: number =
AimVelocity: = .(
DeltaPos.X / TimeToTarget,
(DeltaPos.Y + * Gravity * TimeToTarget^) / TimeToTarget,
DeltaPos.Z / TimeToTarget
)
(Self, Index, AimVelocity)
(Self, Index, Value)
)