Fonctionnel
R15 to R6 Opensource Rework (Animations only)

Code du script
Lua
-- R6 animations for R15 Characters (no reanimation)
-- Based on Roblox's content\avatar\unification\humanoidClassicAnimate.lua
-- Originally edited by Invisible_#3657, patched by mxsynry
--[[
Invisible_#3657 was here OwO, hi invis i love you mwah
]]
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local CUSTOM_ANIM_NAMES = {
idle = { { id = "rbxassetid://12521158637", weight = 9 }, { id = "rbxassetid://12521162526", weight = 1 } },
walk = { { id = "rbxassetid://12518152696", weight = 10 } },
run = { { id = "rbxassetid://12518152696", weight = 10 } },
jump = { { id = "rbxassetid://12520880485", weight = 10 } },
fall = { { id = "rbxassetid://12520972571", weight = 10 } },
climb = { { id = "rbxassetid://12520982150", weight = 10 } },
sit = { { id = "rbxassetid://12520993168", weight = 10 } },
toolnone = { { id = "rbxassetid://12520996634", weight = 10 } },
toolslash = { { id = "rbxassetid://12520999032", weight = 10 } },
toollunge = { { id = "rbxassetid://12521002003", weight = 10 } },
wave = { { id = "rbxassetid://12521004586", weight = 10 } },
point = { { id = "rbxassetid://12521007694", weight = 10 } },
dance1 = { { id = "rbxassetid://12521009666", weight = 10 }, { id = "rbxassetid://12521151637", weight = 10 }, { id = "rbxassetid://12521015053", weight = 10 } },
dance2 = { { id = "rbxassetid://12521169800", weight = 10 }, { id = "rbxassetid://12521173533", weight = 10 }, { id = "rbxassetid://12521027874", weight = 10 } },
dance3 = { { id = "rbxassetid://12521178362", weight = 10 }, { id = "rbxassetid://12521181508", weight = 10 }, { id = "rbxassetid://12521184133", weight = 10 } },
laugh = { { id = "rbxassetid://12521018724", weight = 10 } },
cheer = { { id = "rbxassetid://12521021991", weight = 10 } },
}
if getgenv().R6_On_R15_CLEANUP then
pcall(getgenv().R6_On_R15_CLEANUP)
end
local function v24(Char)
if not Char or not Char.Parent then return end
local Humanoid = Char:FindFirstChildOfClass("Humanoid")
if not Humanoid then return end
local defaultAnimate = Char:FindFirstChild("Animate")
local animateBackup = defaultAnimate and defaultAnimate:Clone()
-- cross-scope state (shared by v25 / v26 / v48)
local connections = {}
local sessionTracks = {}
local isCustomActive = false
local runLoop = nil
local function v25()
if not isCustomActive then return end
isCustomActive = false
if runLoop then
pcall(function() task.cancel(runLoop) end)
runLoop = nil
end
for _, conn in pairs(connections) do
pcall(function() conn:Disconnect() end)
end
connections = {}
for i = 1, #sessionTracks do
local tr = sessionTracks[i]
pcall(function() tr:Stop(0) end)
pcall(function() tr:Destroy() end)
sessionTracks[i] = nil
end
getgenv().R6_On_R15_CLEANUP = nil
end
getgenv().R6_On_R15_CLEANUP = v25
local function v26()
isCustomActive = true
local animator = Humanoid:FindFirstChildOfClass("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = Humanoid
end
for _, track in ipairs(animator:GetPlayingAnimationTracks()) do
pcall(function() track:Stop(0) end)
end
for i = 1, #sessionTracks do sessionTracks[i] = nil end
-- state
local v6 = "Standing" -- movement state
local v8 = "" -- current core anim set name
local v10 = nil -- current playing core track
local v12 = 1 -- current anim speed multiplier
local v15 = "None" -- current tool anim
local v16 = 0 -- tool anim timer
local v17 = 0 -- jump/fall cooldown
local v18 = "" -- current tool anim set name
local v19 = nil -- current playing tool track
local _rigScale = 1
local _lastScaleCheck = 0
local function v27()
local ok, scale = pcall(function() return Char:GetScale() end)
if ok and scale and scale > 0 then _rigScale = scale end
end
v27()
local t = {} -- animation sets; each entry[k] = { anim, track, weight, id }
local t3 = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false }
local TOOL_SETS = { toolnone = true, toolslash = true, toollunge = true }
local TOOL_PRIORITY = {
toolnone = Enum.AnimationPriority.Idle,
toolslash = Enum.AnimationPriority.Action,
toollunge = Enum.AnimationPriority.Action,
}
local v31, v33 -- forward decl (used by keyframe handlers)
local function v28(setName, list)
local set = { count = 0, totalWeight = 0 }
t[setName] = set
for k, v in ipairs(list) do
local anim = Instance.new("Animation")
anim.Name = setName
anim.AnimationId = v.id
local track = animator:LoadAnimation(anim)
track.Priority = TOOL_PRIORITY[setName] or Enum.AnimationPriority.Core
set[k] = { anim = anim, track = track, weight = v.weight, id = v.id }
set.count = set.count + 1
set.totalWeight = set.totalWeight + v.weight
sessionTracks[#sessionTracks + 1] = track
track.KeyframeReached:Connect(function(keyframeName)
if not isCustomActive then return end
if keyframeName ~= "End" then return end
if TOOL_SETS[setName] then
if v19 ~= track then return end
v33(setName, 0, true)
else
if v10 ~= track then return end
local repeatAnim = setName
if t3[repeatAnim] == false then repeatAnim = "idle" end
v31(repeatAnim, 0, true)
end
end)
end
end
for k, v in pairs(CUSTOM_ANIM_NAMES) do
v28(k, v)
end
local function v29(p1)
if p1 == v12 then return end
v12 = p1
if v10 then pcall(function() v10:AdjustSpeed(p1) end) end
end
local function v30()
local oldAnim = v8
if t3[oldAnim] == false then oldAnim = "idle" end
if v10 then pcall(function() v10:Stop(0) end) end
v8 = ""
v10 = nil
return oldAnim
end
function v31(setName, fade, force)
if not isCustomActive then return end
local set = t[setName]
if not set or set.count <= 0 or set.totalWeight <= 0 then return end
local sum = math.random(1, set.totalWeight)
local count = 1
while count <= set.count and set[count].weight < sum do
sum = sum - set[count].weight
count = count + 1
end
local entry = set[count]
if not entry then return end
local track = entry.track
if not force and v10 == track then return end
if v10 and v10 ~= track then
pcall(function() v10:Stop(fade) end)
end
v12 = 1
pcall(function()
track:Play(fade)
track:AdjustSpeed(v12)
end)
v10 = track
v8 = setName
end
function v33(setName, fade, force)
if not isCustomActive then return end
local set = t[setName]
if not set or set.count <= 0 or set.totalWeight <= 0 then return end
local sum = math.random(1, set.totalWeight)
local count = 1
while count <= set.count and set[count].weight < sum do
sum = sum - set[count].weight
count = count + 1
end
local entry = set[count]
if not entry then return end
local track = entry.track
if not force and v19 == track then return end
if v19 and v19 ~= track then
pcall(function() v19:Stop(0) end)
end
pcall(function() track:Play(fade) end)
v19 = track
v18 = setName
end
local function v34()
local oldAnim = v18
if v19 then pcall(function() v19:Stop(0) end) end
v18 = ""
v19 = nil
return oldAnim
end
local function v35(p1)
if not isCustomActive then return end
local speed = p1 / _rigScale
if speed > 0.01 then
v31("walk", 0.1)
if v8 == "walk" then
v29(speed / 14.5)
end
v6 = "Running"
else
if t3[v8] ~= nil then return end
v31("idle", 0.1)
v6 = "Standing"
end
end
local function v36()
if not isCustomActive then return end
v31("jump", 0.1)
v17 = 0.3
v6 = "Jumping"
end
local function v37(p1)
if not isCustomActive then return end
local speed = p1 / _rigScale
v31("climb", 0.1)
v29(speed / 12)
v6 = "Climbing"
end
local function v38()
if not isCustomActive then return end
if v17 > 0 then v6 = "FreeFall"; return end
v31("fall", 0.3)
v6 = "FreeFall"
end
local function v39()
v6 = "GettingUp"
v30()
v34()
end
local function v40()
v6 = "FallingDown"
v30()
v34()
end
local function v41()
v6 = "Seated"
end
local function v42()
v6 = "PlatformStanding"
v30()
v34()
end
local function v43(p1)
v6 = p1 > 0 and "Running" or "Standing"
end
local function v44()
if not Char or not Char.Parent then return nil end
for _, v in ipairs(Char:GetChildren()) do
if v:IsA("Tool") then return v end
end
return nil
end
local function v45(p1)
if not p1 then return nil end
for _, v in ipairs(p1:GetChildren()) do
if v.Name == "toolanim" and v:IsA("StringValue") then return v end
end
return nil
end
local function v46()
if v15 == "None" then v33("toolnone", 0.1) return end
if v15 == "Slash" then v33("toolslash", 0) return end
if v15 == "Lunge" then v33("toollunge", 0) end
end
local v22 = 0
local function v47(p1)
if not isCustomActive then return end
local v32 = p1 - v22
v22 = p1
if v17 > 0 then v17 = v17 - v32 end
if v6 == "Dead" or v6 == "GettingUp" or v6 == "FallingDown" or v6 == "PlatformStanding" then
return
end
if v6 == "Seated" then
v31("sit", 0.5)
elseif v6 == "FreeFall" and v17 <= 0 then
v31("fall", 0.3)
elseif v6 == "Running" then
v31("walk", 0.1)
elseif v6 == "Standing" then
if v8 ~= "idle" and t3[v8] == nil then
v31("idle", 0.1)
end
end
local tool = v44()
if not (tool and tool:FindFirstChild("Handle")) then
if v18 ~= "" then v34() end
v15 = "None"
v16 = 0
return
end
local v7 = v45(tool)
if v7 then
v15 = v7.Value
v7.Parent = nil
v16 = p1 + 0.3
end
if v16 >= p1 then
v46()
else
v16 = 0
v15 = "None"
v46()
end
end
table.insert(connections, Humanoid.Died:Connect(function()
v6 = "Dead"
v30()
v34()
v25()
end))
table.insert(connections, Humanoid.Running:Connect(v35))
table.insert(connections, Humanoid.Jumping:Connect(v36))
table.insert(connections, Humanoid.Climbing:Connect(v37))
table.insert(connections, Humanoid.GettingUp:Connect(v39))
table.insert(connections, Humanoid.FreeFalling:Connect(v38))
table.insert(connections, Humanoid.FallingDown:Connect(v40))
table.insert(connections, Humanoid.Seated:Connect(v41))
table.insert(connections, Humanoid.PlatformStanding:Connect(v42))
table.insert(connections, Humanoid.Swimming:Connect(v43))
table.insert(connections, plr.Chatted:Connect(function(msg)
if not isCustomActive then return end
local emote = ""
if string.sub(msg, 1, 3) == "/e " then emote = string.sub(msg, 4)
elseif string.sub(msg, 1, 7) == "/emote " then emote = string.sub(msg, 8) end
if v6 == "Standing" and t3[emote] ~= nil then
v31(emote, 0.1)
end
end))
local dummyAnimate = Char:FindFirstChild("Animate")
if not dummyAnimate then
dummyAnimate = Instance.new("LocalScript")
dummyAnimate.Name = "Animate"
dummyAnimate.Disabled = true
dummyAnimate.Parent = Char
end
local playEmoteBindable = dummyAnimate:FindFirstChild("PlayEmote")
if not playEmoteBindable then
playEmoteBindable = Instance.new("BindableFunction")
playEmoteBindable.Name = "PlayEmote"
playEmoteBindable.Parent = dummyAnimate
end
playEmoteBindable.OnInvoke = function(emote)
if not isCustomActive then return end
if v6 ~= "Standing" then return end
if t3[emote] == nil then return false end
v31(emote, 0.1)
return true, v10
end
v31("idle", 0.1)
v6 = "Standing"
runLoop = task.spawn(function()
while isCustomActive and Char and Char.Parent and Humanoid and Humanoid.Parent
and Humanoid.RigType == Enum.HumanoidRigType.R15 do
local curr = os.clock()
if curr - _lastScaleCheck > 1 then
_lastScaleCheck = curr
v27()
end
pcall(v47, curr)
task.wait(0.1)
end
end)
end
local function v48()
if not Humanoid or not Humanoid.Parent or Humanoid.Health <= 0 then return end
v25()
local animator = Humanoid:FindFirstChildOfClass("Animator")
if animator then
for _, track in ipairs(animator:GetPlayingAnimationTracks()) do
pcall(function() track:Stop(0) end)
end
end
local existing = Char:FindFirstChild("Animate")
if existing then
existing.Disabled = true
pcall(function() existing:Destroy() end)
end
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
v26()
else
if animateBackup then
local newAnimate = animateBackup:Clone()
newAnimate.Parent = Char
newAnimate.Disabled = false
end
end
end
table.insert(connections, Humanoid:GetPropertyChangedSignal("RigType"):Connect(function()
task.wait(0.1)
v48()
end))
table.insert(connections, Char.AncestryChanged:Connect(function(_, parent)
if not parent then v25() end
end))
v48()
end
if plr.Character then
task.spawn(function()
pcall(v24, plr.Character)
end)
end
if getgenv().v23 then
pcall(function() getgenv().v23:Disconnect() end)
end
getgenv().v23 = plr.CharacterAdded:Connect(function(char)
task.spawn(function()
pcall(v24, char)
end)
end)Description
just a simple animation script with roblox whitelisted animations, somehow they didn't delete it, probably back when roblox was trying to test r15? Test emotes: /e wave /e point /e dance1 /e dance2 /e dance3 /e laugh /e cheer
Commentaires (0)
Connectez-vous pour participer à la conversation
- Soyez le premier à commenter.
Questions fréquentes
- Comment utiliser le script R15 to R6 Opensource Rework (Animations only) ?
- Copiez le code ci-dessus, ouvrez votre exécuteur Roblox, collez le code et appuyez sur exécuter pendant que vous êtes dans le jeu. Les fonctionnalités s'activent instantanément une fois le script lancé.
- Le script R15 to R6 Opensource Rework (Animations only) est-il gratuit ?
- Oui. Ce script est gratuit à copier et utiliser. S'il utilise un système de clé, suivez le lien « Obtenir la clé » pour le débloquer gratuitement.
- Le script R15 to R6 Opensource Rework (Animations only) est-il sûr à utiliser ?
- Le code source complet est affiché sur cette page pour que vous puissiez lire exactement ce qu'il fait avant de l'exécuter. Utilisez toujours un exécuteur de confiance, et n'oubliez pas que l'utilisation de scripts est contraire aux conditions d'utilisation de Roblox — utilisez-les à vos propres risques.
- Quel exécuteur fonctionne avec R15 to R6 Opensource Rework (Animations only) ?
- Ce script fonctionne avec la plupart des exécuteurs Roblox populaires. Consultez notre page d'exécuteurs pour trouver un exécuteur gratuit ou payant fiable pour votre appareil.