My goal: Enable mobile GUI when player is on Mobile, Enable PC GUI when player is on PC.
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
script.Parent.Enabled = true -- MobileGUI
else
script.Parent.Parent.PcGUI.Enabled = true
end
The script is a ServerScript.
Any insights to why it isn't working?

1 comment
Perhaps put the script in the GUI and then say script.Parent.Enabled = true