You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? 2. What is the issue?
Got 1 Animation that Plays when just pressing mouseButton and want another animation to be played when you for example press āDā to walk right + press Mouse while walking
local goingRight = false
game.UserInputService.InputBegan:Connect(function(input: InputObject, gpe: boolean)
if gpe then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if goingRight then
print("going right and clicking")
else
print("only clicking")
end
elseif input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.D then
goingRight = true
end
end
end)
game.UserInputService.InputEnded:Connect(function(input: InputObject, gpe: boolean)
if gpe then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.D then
goingRight = false
end
end
end)