Device Icon Help

Ello, I’m developing an Overhead System. Anyways I have a part where if you have a specific device, like if your on PC the overhead will show a monitor, and if your on mobile a smartphone will show up. The code I used has not been working, any help would be great!

		if userInputService.KeyboardEnabled and userInputService.MouseEnabled and not userInputService.GamepadEnabled and not userInputService.TouchEnabled then
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072719383"

		elseif userInputService.TouchEnabled then
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072722824"

		else
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072980286"
		end

Hope Someone can Help me :hearts:

2 Likes

First here is an Article on UIS.

Could you try this code?:


if userInputService.KeyboardEnabled == true then
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072719383"

		elseif userInputService.TouchEnabled == true then
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072722824"

		else
			script.CoreUI.OverheadGui.Device.Device.Image = "rbxassetid://7072980286"
		end

A potential issue could also be this:

script.CoreUI

Could you send how your Explorer looks?
(The GUI)

Can you specify what you mean by not working? Like there’s no GUI showing up at all or the image isn’t changing?

Okay so as you can see if your on a pc a specific image is going to show up in my overhead. Specifically a monitor, like this:

Note the monitor was not scripted that was when the image ID was in properties.

Your code did not work.
Here’s my explorer:
https://gyazo.com/f84f5280271b68bfc26d99584372a746

For some reason it works in a separate script but not in the main one.