So Here is what I have so far
local UIS = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled
and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then
else
game.Players.LocalPlayer.PlayerGui.TopGuis.Group.Size.Value = UDim2.new({0.293, 0},{0.122, 0})
end
I tested it out on many devices it didn't change a thing. I tested in to local scripts and normal and still nothing. In the output if I put in a regular script it shows an error message on the line about game.Players.LocalPlayers......... and says like attempt to index player gui a nil value. On a local script nothing shows up in the output. Help would be appreciated. My goal here is to change something if detected on a computer. I made the loop to detect for a mobile device and put an else to show when it returns it would be a computer which was my goal to change it. i will change the action it will do but any help will be greatly appreciated.
EDIT: so here is what I have now
local UserInputService = game:GetService("UserInputService")
local label = script.Parent --change to the text label
local frame = script.Parent.Parent
local messages = {
TouchEnabled = "Tap!",
KeyboardEnabled = "E",
GamepadEnabled = "B" --or whatever it is
}
for key, value in pairs(messages) do
if(UserInputService[key]) then
label.Text = value
break
end
end
local sizing = {
TouchEnabled = UDim2.new(0, 0,0, 0)
};
for key, value in pairs(sizing) do
if(UserInputService[key]) then
frame.Size= value
break
end
end
I was originally editing the text for a button but needed to adjust the size of a whole frame as well so the parent.Parent is the frame

3 comments
If you're using the Scaling portion on the X and Y Values, you should be fine, as that size will scale with the device's size. (X Scale, X Offset, Y Scale Y Offset), This is why I prefer to use Scale over Offset as it scales with all devices.
You should not need to detect either
I am using only size but whenever I scale is to a size for pc I check on mobile the size is ok but the text for a button shrinks as it is text scaled I also need help because on mobile it needs to say tap on pc it should say e but I don't get the detection and the change process yet this gui size change is an experiment I will change that part later but I still need the starting base