Yo So I’m trying to make a basic sprint animation and am trying to check if the animation is working before I move on to binding it to a key, however whenever I load up the script I get the error “not a valid member of LocalScript “Workspace.Narcelinee.AnimationHandler”” I never had this issue before so I’m confused, I also wanna know what the error means and how you can fix it for future reference
This is all the script is with ShindenSprint being an animation Object with an assetid put itno it
local sprintAnimation = script.ShindenSprint
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local sprintAnimationTrack = humanoid:LoadAnimation(sprintAnimation)
while true do
sprintAnimation:Play()
end
ok but like its in the StarterPlayerScripts folder which is in workspace, i tried taking the local script out of this folder and putting it in workspace and there were no errors happening but the script wasnt working
local scripts dont work outside of starterplayerscripts, startercharacterscripts, starterGui and starterpack. I recommend putting your script in startercharacterscripts
ya thats what I thought, its in startercharacterscripts but I still get an error, so im confused since startercharacterscripts is in the workspace already cuz if i try to put starterplayer in workspace it doesnt do anything
local sprintAnimation = script.ShindenSprint
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local sprintAnimationTrack = humanoid:LoadAnimation(sprintAnimation)
while true do
sprintAnimationTrack:Play() --Here u used sprintAnimation
end
local animator = humanoid:FindFirstChildOfClass("Animator")
So:
local sprintAnimation = script.ShindenSprint
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local animator = humanoid:FindFirstChildOfClass("Animator")
local sprintAnimationTrack = animator:LoadAnimation(sprintAnimation)
while true do
sprintAnimationTrack:Play() --Here u used sprintAnimation
end
local sprintAnimation = script.ShindenSprint
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local sprintAnimationTrack = humanoid:LoadAnimation(sprintAnimation)
sprintAnimationTrack.Looped = true
sprintAnimationTrack:Play()
I told u needed to use :WaitForChild() it worked for me like this
local sprintAnimation = script:WaitForChild("ShindenSprint")
wait(1)
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char.Humanoid
local animator = humanoid:FindFirstChildOfClass("Animator")
local sprintAnimationTrack = animator:LoadAnimation(sprintAnimation)
while true do
sprintAnimationTrack:Play() --Here u used sprintAnimation
end