local player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if (key == 'c') then local crawl = script.Parent.Humanoid:LoadAnimation(script.Crawl) if script.IsCrawling.Value == false then crawl:Play() script.IsCrawling.Value = true else crawl:Stop() script.IsCrawling.Value = false end end end)
In the output it says Animation Failed to Load. Is it a Roblox Asset Problem??
Mouse input like you're trying to use is deprecated, refer to UserInputService.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:wait() local humanoid = character:WaitForChild("Humanoid") local UserInputService = game:GetService('UserInputService') local crawl = script:WaitForChild('crawl') crawl = humanoid:LoadAnimation(crawl) UserInputService.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.C then -- You can use IsPlaying to see if a sound is playing. if crawl.IsPlaying then crawl:Stop() else crawl:Play() end end end)
Probably because u messed up with the Humanoid. Try this
For ex:
local p = game.Players.LocalPlayer local crawl = p.Character.Humanoid:LoadAnimation(script.Crawl) crawl:Play()