Per Device Datastores?

Hello, I’ve been trying to develop a game for some time now and I’m going to begin work on a brightness calibration setting for the game. The only issue is, I’d like to datastore it. But I’d like to save it per device rather than per player. Is there any way to identify a device? I can’t seem to find info on this anywhere, help is appreciated.

EDIT: For some reason, nobody really understood what I meant. Apologies my wording wasn’t the best. But I’m not talking about console/mobile/pc I’m talking about having multiple PCs and other misc devices.

1 Like

Look into this post.
https://devforum.roblox.com/t/how-to-detect-if-player-is-using-a-phone/178533/2

 local UIS = game:GetService("UserInputService")
 if (UIS.TouchEnabled) then
     -- Mobile Device
 else (UIS.KeyboardEnabled and UIS.MouseEnabled) then
    -- Desktop
 else (UIS.GamepadEnabled) then
    -- Console
 end

This is great except this is limited to CoreScripts. Using this in any other script will just throw an error. Read the very short API document here. What @Xueify is the only method to guess what device a player is using. This can still tend to work out well but since some laptops do have touch screens, some tablet and phone players use controller or keyboards, etc their is issues with identifying what the device really is. So this method can sometimes only be guessing what the device is.

Thanks for pointing that out, fixed.

Well, your current system only partial fixes the issue. Read my previous reply in why this won’t always work as intended.

I don’t think it’s really possible to ever be able to have 100% accuracy with guessing what device is someone is using just from their input method.

It’s almost impossible to get an accurate device type, touchscreen users will have mobile input yet are actually laptops for example.

Lots of results here:
https://devforum.roblox.com/search?context=topic&context_id=178533&q=get%20device%20type&skip_context=true

Even Roblox staff don’t recommend trying to get a specific device type.

1 Like

No one seems to understand what he means.

To answer in short OP, the answer is no. For ROBLOX game to have the capabilities to read identifying device information would be insanely dangerous. I’d recommend just saving it per player, worst case you can save it per player per device (each player would have a console, mobile, and pc save), but past that I can’t imagine it being possible.

2 Likes

Well its a solution nonetheless. Obviously some laptops would have touchscreen, same for some desktops. There are other ways around this; but for this use-case its hard to determine if they’re actually using a different device- what if they connected their controller to their computer, now the game thinks its a console. I think saving settings per device is unnecessary just because what is the chance they play on two different devices in the first place.

This is only partially true.

You can state with 100% certainty whether a player is on console or not using GuiService:IsTenFootInterface, however outside of that I would agree it is a guessing game.

My systems only rely on client detection for things like UIs moving out of the way, where-as everything else is created universally compatible, however I will restate that I don’t think this is what OP means when he says “saving to a device”.

He wants to save a setting for a player for a specific device; i.e mobile, console, desktop. I don’t think he wanted the exact device information like the make and model number, but we’re all speculating here.