local iosActive = false
local iphone = false
if userInputService.TouchEnabled and not userInputService.KeyboardEnabled then
iosActive = true
local gui = Instance.new("ScreenGui")
gui.Parent = script.Parent
local originalMainGui = script.Parent:FindFirstChild("MainGui")
if originalMainGui then
originalMainGui:Destroy()
end
local mainGui
if gui.AbsoluteSize.X >= 1000 and gui.AbsoluteSize.Y >= 700 then
mainGui = game:GetService("ReplicatedStorage"):WaitForChild("Tablet"):Clone()
mainGui.Name = "MainGui"
mainGui.Enabled = true
mainGui.Parent = script.Parent
else
local mainGui = game:GetService("ReplicatedStorage"):WaitForChild("Phone"):Clone()
mainGui.Name = "MainGui"
mainGui.Enabled = true
mainGui.Parent = script.Parent
iphone = true
end
gui:Destroy()
else
script.Parent:WaitForChild("MainGui").Enabled = true
end
COMMUNITY QUESTION
:attempt to index local 'mainGui' (a nil value) ¿?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
¿?
Explain more lol, where is the error, why do you have the upside down questionmark and a normal questionmark??
He tells me that the error is on line 12 in if gui.AbsoluteSize.X >= 1000 and gui.AbsoluteSize.Y >= 700 then