What do you want to achieve? Keep it simple and clear!
I want a check to be made after debounce is set back to false to read if any inputs that can trigger Tool.Activated are being held.
What is the issue? Include screenshots / videos if possible!
I cannot find a way to do this.
What solutions have you tried so far? Did you look for solutions on the Developer Hub? Yes, but all of them were only for computer mouse inputs.
Elsewise, please tell me what inputs can trigger Tool.Activated. Thank you.
Just to be clear you want to know when a tool is being activated?
If so all you have to do is create a function for when the tool is activated:
script.Parent.Activated:Connect(function()
-- stuff here
end)
Also, any click from a device activates a tool. For example, left click on a computer, a press on the screen on mobile, and the right trigger on Xbox are all inputs that can activate a tool!
Hope this helped, if you still have any questions let me know!
I want to know when an input to activate a tool is being held, not starting the input to activate it. I’ll use what you told me about pressing the screen on mobile and the right trigger for controllers to make the function work.
Quick question, can you check if a bool is changed using .Changed?
I looked more into this, try using userinputservice, it can look something like this:
local uis = game:GetService("UserInputService")
hold = false -- not local because it is a global variable
uis.InputBegan:Connect(function(input)
local inputType = input.UserInputType
if inputType == Enum.UserInputType.MouseButton1 then
hold = true
end
end)
uis.InputEnded:Connect(function(input)
local inputType = input.UserInputType
if inputType == Enum.UserInputType.MouseButton1 then
hold = false
end
end)
Hope that works, if not I can try to help further!