Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Instance.New Not Creating Frame?

Asked by 4 years ago

I created a chunk of code that is meant to create a frame.

Line 42 - 46

Please Help Me Fix This.

01local MainMenu = script.Parent
02local PlayButton = MainMenu.Buttons:WaitForChild("PlayButton")
03local SettingsButton = MainMenu.Buttons:WaitForChild("SettingsButton")
04local UpdateButton = MainMenu.Buttons:WaitForChild("UpdateButton")
05local Player = game.Players.LocalPlayer
06 
07-- UI Hover
08 
09-- Player Button
10 
11PlayButton.MouseEnter:Connect(function()
12    PlayButton.TextColor3 = Color3.new(0.133333, 0.133333, 0.133333)
13end)
14 
15PlayButton.MouseLeave:Connect(function()
View all 46 lines...
0
I suggest just making a frame through starterGui, but if you insist on doing it this way, make sure you put this into a local script. ssgmalachi 52 — 4y

3 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

The frame was created, but since you didn't supply enough properties; the frame was not seen. It's there, but you just need to be able to see it. Therefore; we apply more properties to it.

01--[==[
02    You should always be using a ServiceProvider.
03    Both the DataModel & the ServiceProvider service work.
04 
05    Never index a service from the DataModel, if anything can change the names of these services, indexing will break immediently.
06    That is why we have ServiceProvider:GetService
07]==]
08 
09-- How to get the ServiceProvider class. game does work too.
10local ServiceProvider = game:GetService("ServiceProvider")
11 
12local MainMenu = script.Parent
13local Buttons = MainMenu:WaitForChild("Buttons")
14local PlayButton = Buttons:WaitForChild("PlayButton")
15local SettingsButton = Buttons:WaitForChild("SettingsButton")
View all 65 lines...
0
Thanks! NotConnorRandumb 22 — 4y
Ad
Log in to vote
0
Answered by
ads_bv 29
4 years ago

example:

1local frame = instance.new("Frame")
0
Huh? NotConnorRandumb 22 — 4y
Log in to vote
0
Answered by 4 years ago

You can create the frame you want in StarterGui and make it transparent. When the player clicks the play button, just change the transparency to 1 or if you want to make a smooth transition, just use TweenService.

Answer this question