So i have a script that is suppose to enable the player to slide, but the script is not playing the animation.
local Sliding = false local WalkToSlide = Instance.new("Animation") WalkToSlide.AnimationId = "rbxassetid://"..6467630387 local SlideLoopAnimaion = Instance.new("Animation") SlideLoopAnimaion.AnimationId = "rbxassetid://"..6789330585 local WalkToSlideAnimationTrack = Animator:LoadAnimation(WalkToSlide) local SlideLoopAnimationTrack = Animator:LoadAnimation(SlideLoopAnimaion) --#Start sliding local function Slide() if _Delay then return end Sliding = true --_Delay = true WalkToSlideAnimationTrack:Play() WalkToSlideAnimationTrack.Stopped:Connect(function() SlideLoopAnimaion:Play() end) end --#Stop sliding local function StopSlide() if Sliding then return end if not _Delay then return end Sliding = false if WalkToSlideAnimationTrack:IsPlaying() then WalkToSlideAnimationTrack:Stop() else SlideLoopAnimaion:Stop(0.1) end end uis.InputBegan:Connect(function(Key) if Key.KeyCode == Enum.KeyCode.LeftShift then Slide() end end) uis.InputEnded:Connect(function(Key) if Key.KeyCode == Enum.KeyCode.LeftShift then StopSlide() end end)
I made a script in the past which worked but for some reason this script and the older script no longer works. The script is located in StarterPlayer -> StarterPlayerScript.
I think I the problem is that on line 7 you do:
SlideLoopAnimaion.AnimationId = "rbxassetid://"..6789330585
Which instead what you should be doing is:
SlideLoopAnimation.AnimationId = "rbxassetid://6789330585"
There was also a spelling mistake
SlideLoopAnimaion.AnimationId
No L in the Animaion in the SlideLoopAnimaion
unless there isn’t supposed to be an L
Make sure to do the same to line 4
From:
WalkToSlide.AnimationId = "rbxassetid://"..6467630387
To:
WalkToSlide.AnimationId = "rbxassetid://6467630387"