I have a screenGui script that makes a intro in this game (For a tutorial video) and for some reason it won't delete it self after I properly do the screenGui:Destroy()
and frame:Destroy()
Here is the script if you need it
01 | local screenGui = Instance.new( "ScreenGui" ) |
02 | screenGui.Parent = script.Parent |
03 |
04 | local frame = Instance.new( "Frame" ) |
05 | frame.Parent = screenGui |
06 | frame.Position = UDim 2. new( 0 , 0 , 0 , - 50 ) |
07 | frame.Size = UDim 2. new( 0 , 1400 , 0 , 1500 ) |
08 |
09 | wait ( 2 ) |
10 |
11 | local textLabel = Instance.new( "TextLabel" ) |
12 | textLabel.Parent = screenGui |
13 | textLabel.Position = UDim 2. new( 0 , 300 , 0 , 400 ) |
14 | textLabel.Size = UDim 2. new( 0 , 25 , 0 , 50 ) |
15 | textLabel.BackgroundColor 3 = BrickColor.White().Color |
HELP ME
The problem is that FontSize
is an Enum, not a number. Therefore, you should replace lines 40-45 with the following:
1 | for i, v in ipairs (Enum.FontSize:GetEnumItems()) do |
2 | print (v.Name) |
3 | textLabel.FontSize = v |
4 | wait( 0.001 ) -- You may find that this is too small. |
5 | if v = = Enum.FontSize.Size 14 then break end |
6 | end |
This will work fine for your case (up to size 14), but you may need to sort the result of GetEnumItems()
if you plan on going much higher.