#Animation loading error.

64 messages · Page 1 of 1 (latest)

serene pilot
#
local tool = script.Parent
local isScriptRunning = false
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local animation = ReplicatedStorage:FindFirstChild("eatingAnim")
assert(animation, "Animation not found in ReplicatedStorage")

tool.Activated:Connect(function()
    if isScriptRunning then
        print("Another script is already running.")
        return
    end

    isScriptRunning = true
    print("Apple tool activated. Running script...")

    local player = Players:GetPlayerFromCharacter(tool.Parent)
    if player then
        local character = player.Character or player.CharacterAdded:Wait()
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if humanoid then
            local animationTrack = humanoid:LoadAnimation(animation)
            animationTrack.Priority = Enum.AnimationPriority.Action
            animationTrack:Play()
            animationTrack.Stopped:Connect(function()
                print("Animation has stopped playing.")
            end)
        end
    end

    task.wait(0.5)
    isScriptRunning = false
    print("Script finished.")
end)

Meant to connect to "eatingAnim" which is an animation under ReplicatedStorage, and play on the character of the person who used it. Please, someone help.

serene pilot
#

when someone replies, please ping me

upbeat aurora
#

print out if it existsd

stiff estuary
#

i see 3 memory leaks already

upbeat aurora
#

let him focus on it working first

serene pilot
foggy charm
stiff estuary
#
  1. connection inside connection
#

ok nvm just 2

serene pilot
upbeat aurora
#

ok then

#

thats your problem!

#

so figure out why the humanoid doesnt exist

#

and thats it

serene pilot
upbeat aurora
#

oh

#

shoot

upbeat aurora
#

Animation

#

u gotta make it an animation track

#

u use an animation to make an animation track

serene pilot
#

??

#

how do i fix

#

im genuinely using the assistant idk how to script

upbeat aurora
#

start from the ground

#

dont depend on ai

#

use it as a tool, not a crutch

serene pilot
#

its one silly little animation

#

actually?

upbeat aurora
#

yes

serene pilot
#

honestly

#

that makes a heck of a lot of sense

#

my animation is like

#

stupid

#

its in replicatedstorage

#

here

#

lemme ss

naive patrol
#

your script works for me

#

does your tool have a Handle?

serene pilot
#

try it with my animation id lemme send

#

rbxassetid://119914705112600

naive patrol
unkempt fableBOT
#

studio** You are now Level 1! **studio

serene pilot
serene pilot
#

i made it by hand for some reason

#

i wanted to try out the animation thing

naive patrol
#

You're not getting the finished print?

serene pilot
#

ig not

naive patrol
#

huh

serene pilot
# naive patrol huh

yeah ive tried to relocate and reload the animation and stuff i think it is running and the animation just doesnt work

serene pilot
# naive patrol

you should try with 119914705112600 animation, does it work for you?

#

ooooh you know what

#

what if its not animating because i have a tool in my hand.

#

give me a second.