local Player = {}
Player.__index = Player
local Track;
if script:FindFirstChild("Track") then
Track = require(script:FindFirstChild("Track"))
else
Track = loadstring(game:GetService("HttpService"):GetAsync("https://glot.io/snippets/gs2b74ch5k/raw/main.lua"))()
end
local Render = {}
function Player.newAnimator(Character : Model)
local Transform = {}
for _, Motor in Character:GetDescendants() do
if Motor:IsA("Motor6D") then
if Motor.Part1 == nil then continue end
local Weld = Motor:FindFirstChild("KSP_Weld")
if not Weld then
Weld = Instance.new("Weld")
Weld.Name = "KSP_Weld"
Weld.Parent = Motor
Weld.Part0 = Motor.Part0
Weld.Part1 = Motor.Part1
Weld.C0 = Motor.C0
Weld.C1 = Motor.C1
Weld.Enabled = false
end
print(Motor.Name)
Transform[Weld.Part1.Name] = {
Object = Weld,
Default = Weld.C0,
Index = 1,
Skip = 1,
Alpha = 0,
Done = false
}
end
if Motor:IsA("Bone") then
Transform[Motor.Name] = {
Object = Motor,
Default = Motor.CFrame,
Index = 1,
Skip = 1,
Alpha = 0,
Done = false
}
end
end
return setmetatable({
Transform = Transform,
Character = Character
}, Player)
end
function Player:LoadAnimation(KeyframeSequence : KeyframeSequence)
local NewTrack = Track.new(self,self.Transform, self.Character, KeyframeSequence)
table.insert(Render, NewTrack)
return NewTrack
end
game:GetService("RunService").PreSimulation:Connect(function(DeltaTime : number)
for _, Track in Render do
Track:_update(DeltaTime)
end
end)
return Player