local device
if game:GetService("UserInputService").MouseEnabled and game:GetService("UserInputService").KeyboardEnabled then
device = 'Computer'
elseif game:GetService("UserInputService").TouchEnabled then
device = 'Mobile'
end
You can pass device through a remoteevent or remotefunction if you want to use it on the server
Thank you a lot for the help and for taking time! Sorrowfully that we don’t have a desired property or event for that. I hope this is gonna work for my script🙏
thats complex and none really wants something complex as that. while yes, this can happen if the laptop has a touchscreen its really rare. i haven’t seen any laptops have so far a touchscreen except my friend’s which i just befriended a year ago.
I made this script in 5 minutes, so surely you wouldn't want to lose players for such a reason?
local UserInputService = game:GetService("UserInputService")
local input = {
Enum.UserInputType.MouseButton1,
Enum.UserInputType.MouseButton2,
Enum.UserInputType.MouseButton3,
Enum.UserInputType.MouseMovement,
Enum.UserInputType.MouseWheel,
Enum.UserInputType.Keyboard
}
local touch = Enum.UserInputType.Touch
local lastInput
local function inputChanged(lastInputType)
if lastInput ~= input and table.find(input, lastInputType) then
print("mouse and keyboard")
lastInput = input
elseif lastInput ~= touch and lastInputType == touch then
print("touch")
lastInput = touch
end
end
UserInputService.LastInputTypeChanged:Connect(inputChanged)
I know many people who would play newer games if the developers simply made such easy adjustments to give them a better experience.
this… is a messy script. always getting the inputs(what if i want to check it again in another script?, i’ll have to repaste the whole thing, instead of doing that i could store the inputs elsewhere!) and the if statements… nasty, you would not lose players really, its based. and by complex i meant, you can just check if they have touch enabled than just doing all of that all of that, while yes, your method will ensure it, its not really necessary in my opinion as i dont think anyone uses touch screen on their laptops if the feature is in it, that may be me, but as a example my friends dont, so thats my opinion