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

My Script is breaking?

Asked by 11 years ago

I do this but it keeps breaking

Main Script:

01function 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
06                v:Destroy()
07            else
08                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
09                v.Position = v.Position - UDim2.new(0,0,0,15)
10            end
11        end
12    end
13end
14 
15game:GetService("Players").PlayerAdded:connect(function(player)
View all 37 lines...

What I need to add:

1newchatline.Text = player.Name=='EmperorF' and ("[SMITE FOUNDER] "..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg)
2newchatline.Text = player.Name=='thekingsband' and ("[SMITE CO-FOUNDER] "..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg)
3newchatline.Text = player.Name=='tyopido' and ("[SMITE HEAD DEVELOPER] "..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg)
4newchatline.Text = player.Name=='randomman1234' and ("[SMITE DEVELOPER] "..player.Name.. ": " ..msg) or (player.Name.. ": " ..msg)

In all:

01function 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
06                v:Destroy()
07            else
08                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
09                v.Position = v.Position - UDim2.new(0,0,0,15)
10            end
11        end
12    end
13end
14 
15game:GetService("Players").PlayerAdded:connect(function(player)
View all 40 lines...

But it wont work someone help?

1 answer

Log in to vote
0
Answered by
3rdblox 30
11 years ago

Posting large blocks of code isn't usually a good idea here. Try to pin the issue down then come back, shorter posts get replies faster.

Ad

Answer this question