My Animations won’t load after resetting, now i’ve searched around the forum for a solution and found multiple topics about it, however the scripts in those topics are either very unsimiliar with mine or has a different error, I gave up looking for a similar topic since there isn’t many about this. here is my animation script
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local KeyHeld = false
if not character or not character.Parent then
character = player.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://6449883368"
local AnimTrack = animator:LoadAnimation(Anim)
AnimTrack.Priority = Enum.AnimationPriority.Action
function onKeyPress(inputObject,gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.C and not gameProcessed then
KeyHeld = true
while KeyHeld do
AnimTrack:Play()
humanoid.WalkSpeed = 0
wait()
end
end
end
function onKeyRelease(inputObject,gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.C then
KeyHeld = false
AnimTrack:Stop()
humanoid.WalkSpeed = 16
wait()
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
game:GetService("UserInputService").InputEnded:connect(onKeyRelease)
script is stored in the StarterPlayerScripts