Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How do I get newest ROBLOX Animations back into the game?

Asked by 8 years ago

I have the following script that disables it, (And I WILL NOT REMOVE IT, SO DO NOT SUGGEST ME TO REMOVE THIS SCRIPT...)

game.Players.PlayerAdded:connect(function(plr) --Fires a function when a player is added, plr is the player that was added.
    plr.CharacterAdded:connect(function(char) --Fires a function when the player's character has spawned in or respawned, char is the character.
        char:WaitForChild("Humanoid").Name = "NotHumanoid" --Change the name of the humanoid.
    end)
end)

I also tried an animationscript

(Global)

function extractAndInstall(player)
    if player.Character:FindFirstChild("Animate") == nil then repeat wait() until player.Character:FindFirstChild("Animate") ~= nil end
    player.Character:FindFirstChild("Animate"):Destroy()
    local k = script.Parent.AnimNew:clone()
    k.Parent = player.Character
    k.Disabled = false
end

function hello(player)
    player.CharacterAdded:connect(function()
        extractAndInstall(player)
    end)
end

game.Players.PlayerAdded:connect(hello)
for i = 1, #game.Players:GetChildren() do
    hello(game.Players:GetChildren()[i])
end

AND

(LOCAL)

local Figure = script.Parent
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")

jumprebouncetime = 0.6
equipspeed = 0.5
lastjump = 0
lastrun = 0
runtime = 0
equipped = 0
lastslash = 0
lastlunge = 0
slash = false
lunge = false
dual = false
pose = "Standing"
lastpose = "Standing"
hastool = false
tool = nil

Figure.ChildAdded:connect(function(child)
    if child.Name == "NewAnimate" and child:IsA("LocalScript") and child ~= script then
        wait()
        child.Parent = nil
    end
    if child.Name == "Handle" then
        dual = true
        equipped = tick()
    end
end)

Figure.ChildRemoved:connect(function(child)
    if child.Name == "Handle" then
        dual = false
    end
end)

function checkAnim(thing)
    if thing:IsA("StringValue") and thing.Name == "toolanim" then
        if thing.Value == "None" then
            if pose ~= "Jumping" and pose ~= "Running" and pose ~= "Sitting" then
                RightShoulder.DesiredAngle = 1.5
                if dual then
                    LeftShoulder.DesiredAngle = -1.5
                end
            end
        elseif thing.Value == "Slash" then
            slash = true
            lastslash = tick()
        elseif thing.Value == "Lunge" then
            RightShoulder.MaxVelocity = 0.5
            LeftShoulder.MaxVelocity = 0.5
            RightHip.MaxVelocity = 0.5
            LeftHip.MaxVelocity = 0.5
            RightShoulder:SetDesiredAngle(1.57)
            if not dual then
                LeftShoulder:SetDesiredAngle(0.7)
            else
                LeftShoulder:SetDesiredAngle(-1.57)
            end
            RightHip:SetDesiredAngle(1.7)
            LeftHip:SetDesiredAngle(1.7)
            lunge = true
            lastlunge = tick()
        else
            print("Bad toolanim parameter")
        end
        wait()
        thing:Destroy()
    end
end

function checkTool()
    check = script.Parent:GetChildren()
    for i = 1, #check do
        if check[i]:IsA("Tool") then
            hastool = true
            tool = check[i]
            tool.ChildAdded:connect(checkAnim)
            return
        end
    end
    hastool = false
    tool = nil
end

function animUpdate()
    scale = Humanoid.WalkSpeed/16
    Neck.MaxVelocity = 0.01
    RightShoulder.MaxVelocity = 0.5
    LeftShoulder.MaxVelocity = 0.5
    RightHip.MaxVelocity = 0.5
    LeftHip.MaxVelocity = 0.5
    if lastjump+jumprebouncetime > tick() then
        RightHip.DesiredAngle = -0.3
        LeftHip.DesiredAngle = 0.3
        RightHip.MaxVelocity = 0.4
        LeftHip.MaxVelocity = -0.4
    else
        RightHip.MaxVelocity = 0.25*scale
        LeftHip.MaxVelocity = 0.25*scale
    end
    if pose == "Running" then
        lol = -1
        if math.floor(tick()*3.75) % 2 == 0 then
            lol = 1
        end
        if not hastool then
            RightShoulder.DesiredAngle = lol
            RightShoulder.MaxVelocity = 0.5
            LeftShoulder.DesiredAngle = lol
        else
            RightShoulder.DesiredAngle = ((lol/10)+1.2)
            if equipped+equipspeed < tick() then
                RightShoulder.MaxVelocity = 0.02
            else
                RightShoulder.MaxVelocity = 0.5
            end
            if dual then
                if equipped+equipspeed > tick() then
                    LeftShoulder.MaxVelocity = 0.02
                else
                    LeftShoulder.MaxVelocity = 0.5
                end
                LeftShoulder.DesiredAngle = ((lol/10)-1.2)
            else
                LeftShoulder.DesiredAngle = lol
            end
        end
        if lastjump+jumprebouncetime <= tick() then
            RightHip.DesiredAngle = lol
            LeftHip.DesiredAngle = lol
        end
        Neck.DesiredAngle = lol/22
    else
        lol = 0.02
        RightShoulder.DesiredAngle = lol
        LeftShoulder.DesiredAngle = lol
        if lastjump+jumprebouncetime <= tick() then
            RightHip.DesiredAngle = lol
            LeftHip.DesiredAngle = lol
        end
        Neck.DesiredAngle = lol/22
    end
    if pose == "Standing" then
        angle = math.sin(tick())/31
        RightShoulder:SetDesiredAngle(-angle+0.08)
        LeftShoulder:SetDesiredAngle(angle-0.08)
        RightHip:SetDesiredAngle(-angle+0.08)
        LeftHip:SetDesiredAngle(angle-0.08)
        if hastool then
            RightShoulder.DesiredAngle = 1.35-angle
            if dual then
                LeftShoulder.DesiredAngle = -1.35+angle
            end
        end
    elseif pose == "Jumping" then
        LeftHip.DesiredAngle = -0.5
        RightHip.DesiredAngle = 0.5
        if not hastool then
            RightShoulder.DesiredAngle = 1
            LeftShoulder.DesiredAngle = -1
        else
            RightShoulder.DesiredAngle = 1.35
            if dual then
                LeftShoulder.DesiredAngle = -1.35
            else
                LeftShoulder.DesiredAngle = -1
            end
        end
    elseif pose == "Sitting" then
        LeftHip.DesiredAngle = -1.3
        RightHip.DesiredAngle = 1.3
        RightShoulder.DesiredAngle = 1.2525252525
        LeftShoulder.DesiredAngle = -1.2525252525
    end
    if pose ~= "Jumping" and pose ~= "Running" and pose ~= "Sitting" then
        if hastool then
            RightShoulder.DesiredAngle = 1.4
            if dual then
                LeftShoulder.DesiredAngle = -1.4
            end
        end
    end
    if lastslash+0.4 > tick() then
        if pose ~= "Running" then
            RightShoulder.DesiredAngle = 0
        else
            RightShoulder.DesiredAngle = 1.2
            if dual then
                LeftShoulder.DesiredAngle = -1.2
            end
        end
        slash = true
    else
        slash = false
    end
    if lastlunge+1 > tick() then
        RightShoulder.MaxVelocity = 0.5
        LeftShoulder.MaxVelocity = 0.5
        RightHip.MaxVelocity = 0.5
        LeftHip.MaxVelocity = 0.5
        RightShoulder:SetDesiredAngle(1.57)
        if not dual then
            LeftShoulder:SetDesiredAngle(1.0)
        else
            LeftShoulder:SetDesiredAngle(-1.57)
        end
        RightHip:SetDesiredAngle(1.57)
        LeftHip:SetDesiredAngle(1.0)
        lunge = true
    else
        lunge = false
    end
    if pose == "Climbing" then
        lol = -2
        lol2 = -1
        if math.floor(tick()*3.75) % 2 == 0 then
            lol = -5
            lol2 = 1
        end
        RightShoulder.MaxVelocity = 0.25
        LeftShoulder.MaxVelocity = 0.25
        RightHip.MaxVelocity = 0.15
        LeftHip.MaxVelocity = 0.15
        RightShoulder.DesiredAngle = lol
        LeftShoulder.DesiredAngle = lol
        if lastjump+jumprebouncetime <= tick() then
            RightHip.DesiredAngle = lol2
            LeftHip.DesiredAngle = lol2
        end
        Neck.DesiredAngle = lol2/15
    end
    if slash then
        RightShoulder.MaxVelocity = 0.5
        RightShoulder.DesiredAngle = 0.2
        if dual then
            LeftShoulder.MaxVelocity = 0.5
            LeftShoulder.DesiredAngle = -0.2
        end
    end
    lastpose = pose
end

function platformStand()
    pose = "Standing"
end

function sitting()
    pose = "Sitting"
end

function climbing()
    pose = "Climbing"
end

function fall()
    --local lastp = pose..""
    if Humanoid.Jump or pose == "Jumping" or lastjump+jumprebouncetime < tick() then
        return
    end
    wait(0.1)
    if Humanoid.Jump or pose == "Jumping" or lastjump+jumprebouncetime < tick() then
        return
    end
    pose = "Jumping"
    Figure["Right Leg"].Touched:wait()
    pose = "Jumping"
    lastjump = tick()
end

function running(speed)
    if speed > 0 then
        pose = "Running"
    else
        pose = "Standing"
    end
end

function jumping()
    if pose == "Climbing" then
        return
    end
    pose = "Jumping"
    lastjump = tick()
end

Humanoid.Running:connect(running)
Humanoid.Jumping:connect(jumping)
Humanoid.PlatformStanding:connect(platformStand)
Humanoid.FreeFalling:connect(fall)
Humanoid.FallingDown:connect(fall)
Humanoid.Seated:connect(sitting)
Humanoid.Climbing:connect(climbing)
Humanoid.Swimming:connect(climbing)
Humanoid.GettingUp:connect(climbing)

while wait() do
    checkTool()
    animUpdate()
end

Any help offered?

0
China called, they want their wall back. If you want the animations to work, perhaps consider trying to learn how they work. User#6546 35 — 8y

Answer this question