i have a fps game the mobile buttons are broken
screen gui > script and frame
inside frame > img button and text lable > local script (inside img button)
the script
if game:GetService(“TouchInputService”).TouchEnabled == true then
for _,v in pairs(script.Parent:GetChildren()) do
if v.ClassName == “Frame” then
v.Visible = true
end
end
end
the local script
– We must get the UserInputService before we can use it
local UserInputService = game:GetService(“UserInputService”)
– A sample function providing one usage of InputBegan
local function onInputBegan(input, gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print(“The left mouse button has been pressed!”)
end
end
UserInputService.InputBegan:Connect(onInputBegan)
i used local script from UserInputService
![Screenshot 2020-12-23 125904](http://devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/3/5/b/35b310a29449647ac524e714bb670ee3ea5fbbc7.png)
![Screenshot 2020-12-23 125909](http://devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/3/6/6/3668e5552f22c42b10ff762bae2d4234f3dc1894.png)