UserInputService would also work, but I think it would be better to use MouseButton1Down and MouseButton1Up since @RealingZeeKung mentioned that he wants to detect if a mobile user touched or stopped touching a GuiButton since they have event for that built-in to them
No i don’t think MouseBUtton1Down and MouseButton1Up is works on mobile
because the mobile doesnt have mouse and you use Finger to touch it so i think it doesnt works
script.Parent.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
istouched = true
event:FireServer(istouched)
end
end)
script.Parent.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch then
istouched = false
event:FireServer(istouched)
end
end)
This code i tried and it doesnt work i think i script something wrong
I would recommend marking one of the posts as the solution as to help others who may have a have a similar question to yours can find the answer easily
His code wouldn’t have worked since you can’t put events in if statements and StartTouched and EndTouched are not real events,
The solution was eventually discovered to be MouseButton1Down and MouseButton1Up, the things OP thought only worked on computers but can also work on mobile devices with touch input