I'm trying to make mobile support in the form of a gui, but this script doesn't work.
local Players = game:GetService("Players")
function onPlayerAdded(player)
if game:GetService('UserInputService').TouchEnabled then
script.Parent.Frame.Visible = true
else
script.Parent.Frame.Visible = false
end
end
Players.PlayerAdded:connect(onPlayerAdded)
Thanks for any help!

3 comments
UserInputService is localscript only.
Its already a local script
PlayerAdded won't work for the player running the LocalScript. It will instead wait for a new player. Use LocalPlayer instead.