New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Can an animations time position be server sided? If not what can I use?

Asked by 14 days ago

So I finally got my script to print out an animations time position. It keeps saying "0". Does that mean I need to make it client sided, or is there another way to tell an animations time position that IS server sided? The animations are in a humanoid playing. The two chunks of code I sent is in one server script.

This makes the humanoid.

--Load Dance Tracks
for i, dance in pairs(getR15Dances) do
    local newTest = Instance.new("Humanoid")
    newTest.Name = dance.Name
    newTest.Parent = testers
    --Make Animation/Load Animation.--
    local animation=Instance.new("Animation",testers)
    animation.Name="Animation"
    animation.AnimationId = "rbxassetid://"..dance.Id.Value
    anim=newTest:LoadAnimation(animation)
    anim:Play()
    local danceTime = Instance.new("NumberValue")
    danceTime.Name = dance.Name
    danceTime.Parent = danceTimes
    danceTime.Value = anim.TimePosition
end

Updater

--Update times.
while true do
    wait()
    local getTesters = testers:GetChildren()
    for i, tester in pairs(getTesters) do
        if tester:IsA("Humanoid") then
            local getDance = tester:GetPlayingAnimationTracks()
            for i, animation in pairs (getDance) do
                danceTimes[tester.Name].Value = animation.TimePosition
                print(animation.TimePosition)
            end
        end
    end
end

Answer this question