What do you want to achieve?
I would like to create a tool (a tablet) that, when activated (clicked), makes a GUI appear which will act as the tablet’s screen and have many buttons that will bring up other menus.
What is the issue?
The code will not work. While it is simple, It shouldn’t be too complicated since I am just using an event.
local Tablet = script.Parent
local TabletScreen = game.StarterGui.ScreenGui
function OpenTablet()
TabletScreen.Frame.Visible = true
end
Tablet.Activated:Connect(OpenTablet)
You are changing the Frame on the StarterGui, not the FrameInstance of the Player. What i mean is that you need to change it from the Player, like this:
local Tablet = script.Parent
local Player = game.Players.LocalPlayer --assuming that this is a localscript, you are getting the Player
local TabletScreen = Player.PlayerGui.ScreenGui
function OpenTablet()
TabletScreen.Frame.Visible = true
end
Tablet.Activated:Connect(OpenTablet)