So my script that destroy's a gui for mobile users isn't doing what its meant to do
local UserInputService = game:GetService("UserInputService")
if (UserInputService.KeyboardEnabled) then
script.Parent.Parent.Parent.MobilGui:Destroy()
end
So my script that destroy's a gui for mobile users isn't doing what its meant to do
local UserInputService = game:GetService("UserInputService")
if (UserInputService.KeyboardEnabled) then
script.Parent.Parent.Parent.MobilGui:Destroy()
end
For first, you can put UserInputService.KeyboardEnabled == true is better. and put the scripts with child of GUI
and use this: script.Parent:Destroy()
In my point of view, your script is perfect just need to do these things
Here is the script:
local UserInputService = game:GetService("UserInputService")
wait()
if UserInputService.KeyboardEnabled == true then
script.Parent.MobilGui:Destroy()
end
Hope it helped! :) Errors? tell-me on comments.
y do u need a wait()
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Instead of using script.Parent.Parent.Parent place the local script as the child of MobilGui