Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Fall animation not running and not showing any errors?

It doesn't show any errors with the local script but only the animations do not run.

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

repeat wait() until plr.Character.Parent == workspace.FlightModel
repeat wait()until plr.Character.Parent == workspace


mouse.KeyDown:Connect(function(key)
	key = key:lower()
	if key == "w" or key == "a" or key == "s" or key == "d" then
		plr.Character.Animate.fall.FallAnim.AnimationId = "rbxassetid://2269489808"
		while true do
			wait(.1)
			plr.Character.LowerTorso.BodyVelocity.Velocity = Vector3.new(plr.Character.Humanoid.MoveDirection.X * 100, 	plr.Character.LowerTorso.BodyVelocity.Velocity.y, plr.Character.Humanoid.MoveDirection.Z * 100)
		end
	end
end)

mouse.KeyUp:Connect(function(key)
	key = key:lower()
	if key == "w" or key == "a" or key == "s" or key == "d" then
		plr.Character.Animate.fall.FallAnim.AnimationId = "rbxassetid://2230124960"
	end
end)

2 comments

0

I suggest using UserInputService (https://wiki.roblox.com/index.php?title=API:Class/UserInputService) instead of KeyDown (deprecated), you're using it wrong.

0

Please post your script in a code block.

1 answer

mouse.KeyUp and mouse.KeyDown are deprecated, use UserInputService

Link to article: http://wiki.roblox.com/index.php?title=API:Class/UserInputService Other articles:http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputChanged http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputEnded

An example how you would use InputBegan (if you are not familiar):

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.E then
		print("E")
	end
end)

I do not see anything else wrong with your script, try replacing your events with the one I showed, good luck!

(P.s I barely read your script, had no codeblock and was very messy so I assume this shall be the only mistake)

This discussion is preserved as it was. New answers, comments, and votes are closed.