I can only do the mouse hold and mouse release by using mouse.Button1Down and Mouse.Button1Up.
local input = game:GetService("UserInputService") local plr = game.Player.LocalPlayer input.InputBegin:Connect(function() -- everything u type or click will be recorded if input.UserInputType == Enum.UserInputType.MouseButton1 and plr.Character ~= nil then -- if mousebutton1 is clicked aka left mouse button, and checks if plr.Character is a thing local anim = instance.new("animation") -- makes animation anim.Animationid = "http://www.roblox.com/asset/?id=Animation here" -- specify animation id local track = plr.Character.Humanoid:LoadAnimation(anim) -- loads the animation track:Play() -- plays animation -- ur code here end end) input.InputEnded:Connect(function() -- everything u type or click will be recorded this will activate when u release ur key if input.UserInputType == Enum.UserInputType.MouseButton1 then -- when u released ur click -- ur code here end end)
Not sure if this is what u wanted but i hope it helps here is some more info = https://developer.roblox.com/en-us/api-reference/class/UserInputService
Closed as Not Constructive by User#29913, youtubemasterWOW, and Leamir
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?