Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to detect a device?

I know this isn't an Ask and Get service, but I want to know if it is possible to detect what device is being used.

Basically, I need a script that goes through something like

if Player is on Android/IOS --Or whatever the first bit of the script will be

game.Lighting.gear:Clone().Parent=Player.Backpack
game.Lighting.gear:Clone().Parent=Player.StarterGear

end

If anyone knows, that will be grand!

  • Michael

1 answer

✓ Accepted answer

Not sure if this helps, I don't know of any way to check what device is being used, but there is a way to check if there's a touch screen connected. Maybe we can put something together that checks if there's a touch screen but no mouse and keyboard then it may be a phone or tablet. I didn't test this script.

local Input = Game:GetService('UserInputService')
if Input.TouchEnabled and not Input.MouseEnabled and not Input.KeyboardEnabled then
	game.Lighting.gear:Clone().Parent=Player.Backpack
	game.Lighting.gear:Clone().Parent=Player.StarterGear
end

Maybe there is another way around, but this is what I can come up with.

1 comment

0

Thanks! I guess this will do for a while until a new script surfaces its self or some new APIs show up.

This discussion is preserved as it was. New answers, comments, and votes are closed.