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

Why Won't The Bus Animation Play In A LocalScript?

Asked by 1 year ago
Edited 1 year ago

Hello! So today I was making an animation for a bus, and I wanted to put the animation of the bus when a player joins the game, and make the local player the only one that can see the bus animation. I inserted an "AnimationController" in the bus, and then I inserted an Animation object named "BusGoesOff" and an "Animator" inside the AnimationController. This is the script I made:

local Animator = script.Parent:FindFirstChildWhichIsA("Animator") or"Animator",script.Parent.AnimationController)

local Animations = {}

    local BusGoesOff = script.Parent.AnimationController.BusGoesOff


        Animations.BusGoesOff = Animator:LoadAnimation(BusGoesOff)


    until Animations.BusGoesOff and Animations.BusGoesOff.Length > 0



This script seems to work just fine if I insert it in a script, but when I paste this code in a local script, then nothing happens and nothing appears in the output. I also want to make a function that only plays this when a player enters the game. Like a small introduction to the game. Can someone help me and re-make me the script or tell me what objects I need to put where please? Thank you very much. Have a nice day/night.

Is the local script in the workspace because local scripts only work in player gui, a players PlayerScripts, a players character, a players backpack, and the replicatedFirst service so if it isnt in one of these that might be why it doesnt work iamnotcool235_s 27 — 1y

Answer this question