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

Roblox' Animation works fine offline, but not online. Local Scripts used. How can this be fixed?

Asked by 9 years ago

Here is a simple excerpt from a Local Script in the starter pack.

function KeyPress(PressedKey)
local key = string.lower(PressedKey)
    --if key:byte() == 9 then ----------------------------PARRY ANIMATION/CODE
        if key == "r" then      
        local hum = script.Parent.Parent.Character:FindFirstChild("Humanoid")
        local occ = script.Parent.Parent.Character:findFirstChild("Torso"):findFirstChild("isOccupied")
        if occ.Value == false then
            occ.Value = true

        local anim = Instance.new("Animation")
        --anim.AnimationId ="http://www.roblox.com/Asset?ID=27762691"
        anim.AnimationId = "http://www.roblox.com/asset/?id=27762691"
        local anime = hum:LoadAnimation(anim)
        anime:Play()
        wait(2)     
        anime:Stop()
        anime:remove()
        wait(.3)
        occ.Value = false
        end
    end

Answer this question