My Script is breaking?
I do this but it keeps breaking
Main Script:
01 | function UpdateOldLabels(Parent) |
02 | for i,v in pairs (Parent:GetChildren()) do |
03 | if v.Name:sub( 1 , 4 ):lower() = = "line" then |
04 | local LineNumber = v.Name:sub( 5 ) |
05 | if LineNumber = = "12" then |
08 | v.Name = "line" .. tostring ( tonumber (LineNumber) + 1 ) |
09 | v.Position = v.Position - UDim 2. new( 0 , 0 , 0 , 15 ) |
15 | game:GetService( "Players" ).PlayerAdded:connect( function (player) |
16 | player.Chatted:connect( function (msg) |
17 | for _,v in ipairs (game:GetService( "Players" ):GetChildren()) do |
18 | UpdateOldLabels(v:WaitForChild( "PlayerGui" ).ChatGui.Frame) |
19 | newchatline = Instance.new( "TextLabel" ,v:WaitForChild( "PlayerGui" ).ChatGui.Frame) |
20 | newchatline.Text = player.Name = = 'EmperorF' and ( "[SMITE FOUNDER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
21 | newchatline.Size = UDim 2. new( 1 , 0 , 0 , 15 ) |
22 | newchatline.Position = UDim 2. new( 0 , 0 , 1 ,- 15 ) |
23 | newchatline.Font = "SourceSansBold" |
24 | newchatline.TextColor 3 = player.Name = = "EmperorF" and BrickColor.new( "Bright red" ).Color or player.TeamColor.Color |
25 | newchatline.TextStrokeTransparency = 0 |
26 | newchatline.BackgroundTransparency = 1 |
27 | newchatline.BorderSizePixel = 0 |
28 | newchatline.FontSize = "Size14" |
29 | newchatline.TextXAlignment = "Left" |
30 | newchatline.TextYAlignment = "Top" |
31 | newchatline.ClipsDescendants = true |
32 | newchatline.Name = "line1" |
34 | UpdateOldLabels(game:GetService( "StarterGui" ).ChatGui.Frame) |
35 | newchatline:Clone().Parent = game:GetService( "StarterGui" ).ChatGui.Frame |
What I need to add:
1 | newchatline.Text = player.Name = = 'EmperorF' and ( "[SMITE FOUNDER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
2 | newchatline.Text = player.Name = = 'thekingsband' and ( "[SMITE CO-FOUNDER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
3 | newchatline.Text = player.Name = = 'tyopido' and ( "[SMITE HEAD DEVELOPER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
4 | newchatline.Text = player.Name = = 'randomman1234' and ( "[SMITE DEVELOPER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
In all:
01 | function UpdateOldLabels(Parent) |
02 | for i,v in pairs (Parent:GetChildren()) do |
03 | if v.Name:sub( 1 , 4 ):lower() = = "line" then |
04 | local LineNumber = v.Name:sub( 5 ) |
05 | if LineNumber = = "12" then |
08 | v.Name = "line" .. tostring ( tonumber (LineNumber) + 1 ) |
09 | v.Position = v.Position - UDim 2. new( 0 , 0 , 0 , 15 ) |
15 | game:GetService( "Players" ).PlayerAdded:connect( function (player) |
16 | player.Chatted:connect( function (msg) |
17 | for _,v in ipairs (game:GetService( "Players" ):GetChildren()) do |
18 | UpdateOldLabels(v:WaitForChild( "PlayerGui" ).ChatGui.Frame) |
19 | newchatline = Instance.new( "TextLabel" ,v:WaitForChild( "PlayerGui" ).ChatGui.Frame) |
20 | newchatline.Text = player.Name = = 'EmperorF' and ( "[SMITE FOUNDER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
21 | newchatline.Text = player.Name = = 'thekingsband' and ( "[SMITE CO-FOUNDER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
22 | newchatline.Text = player.Name = = 'tyopido' and ( "[SMITE HEAD DEVELOPER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
23 | newchatline.Text = player.Name = = 'randomman1234' and ( "[SMITE DEVELOPER] " ..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg) |
24 | newchatline.Size = UDim 2. new( 1 , 0 , 0 , 15 ) |
25 | newchatline.Position = UDim 2. new( 0 , 0 , 1 ,- 15 ) |
26 | newchatline.Font = "SourceSansBold" |
27 | newchatline.TextColor 3 = player.Name = = "EmperorF" and BrickColor.new( "Bright red" ).Color or player.TeamColor.Color |
28 | newchatline.TextStrokeTransparency = 0 |
29 | newchatline.BackgroundTransparency = 1 |
30 | newchatline.BorderSizePixel = 0 |
31 | newchatline.FontSize = "Size14" |
32 | newchatline.TextXAlignment = "Left" |
33 | newchatline.TextYAlignment = "Top" |
34 | newchatline.ClipsDescendants = true |
35 | newchatline.Name = "line1" |
37 | UpdateOldLabels(game:GetService( "StarterGui" ).ChatGui.Frame) |
38 | newchatline:Clone().Parent = game:GetService( "StarterGui" ).ChatGui.Frame |
But it wont work someone help?