Help With Identification Cards

ello, I am in the process of making ID cards which say your Username and Device so far. The problem is my Device detection part is not working. The username and UserImage is fine its just the Device Part,


local frame = script.Parent

local player = game.Players.LocalPlayer

local userid = player.UserId
local thumType = Enum.ThumbnailType.HeadShot
local thumSize = Enum.ThumbnailSize.Size420x420
local content = game.Players:GetUserThumbnailAsync(userid, thumType, thumSize)

frame.userImage.Image = content
frame.User.Text = player.Name

if Enum.DeviceType.Desktop then
	frame.Device.Text = "PC"
elseif Enum.DeviceType.Tablet then
	frame.Device.Text = "Mobile"
elseif Enum.DeviceType.Phone then
	frame.Device.Text = "Mobile"

When I joined the game on PC it did say PC, though when I joined on mobile It still said PC.
If you could help that would be awesome!
Image of what it is so far:

Roblox does not have a public API for checking the platform. You’re currently checking Enums, which are just numbers:

To actually get the platform, there’s no 100% accurate method, but modules like these makes it possible to easily retrieve the platform type.

Okay, thanks i’ll try this! I’ll let you know if I need help on anything else.

1 Like