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

Script preventing character from loading?

Asked by 10 years ago

I made a custom chat script, but every time i enter the game to test it it stays on "Waiting for Character," and I'm wondering if theres something in the script thats causing it.

Script:

function UpdateOldLabels(Parent)
    for i,v in pairs(Parent:GetChildren()) do
        if v.Name:sub(1,4):lower() == "line" then
            local LineNumber = v.Name:sub(5)
            if LineNumber == "12" then
                v:Destroy()
            else
                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
                v.Position = v.Position - UDim2.new(0,0,0,15)
            end
        end
    end
end

game:GetService("Players").PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
        for _,v in ipairs(game:GetService("Players"):GetChildren()) do
            UpdateOldLabels(v:WaitForChild("PlayerGui").ScreenGui.Frame)
            newchatline = Instance.new("TextLabel",v:WaitForChild("PlayerGui").ScreenGui.Frame)
            newchatline.Text = player.Name.. ": " ..msg
            newchatline.Size = UDim2.new(1,0,0,15)
            newchatline.Position = UDim2.new(0,0,1,-15)
            newchatline.Font = "SourceSans"
            newchatline.TextColor3 = Color3.new(random)
            newchatline.TextStrokeTransparency = 0.8
            newchatline.TextStrokeColor3 = Color3.new(random)
            newchatline.BackgroundTransparency = 1
            newchatline.BorderSizePixel = 0
            newchatline.FontSize = "Size24"
            newchatline.TextXAlignment = "Left"
            newchatline.TextYAlignment = "Top"
            newchatline.ClipsDescendants = true
            newchatline.Name = "line1"
        end
        UpdateOldLabels(game:GetService("StarterGui").ScreenGui.Frame)
        newchatline:Clone().Parent = game:GetService("StarterGui").ScreenGui.Frame
    end)
end)

3 answers

Log in to vote
3
Answered by
Sublimus 992 Moderation Voter
10 years ago

There is nothing in this script to cause that, go to players in studio, and make sure that the 'CharacterAutoLoads' option is checked.

Ad
Log in to vote
0
Answered by
yurhomi10 192
10 years ago

scripts start before the player enters, therefore the script doesnt find any players so it wont work

try this

repeat 
wait()
until player
0
It's in a PlayerAdded event TheGuyWithAShortName 673 — 10y
Log in to vote
-3
Answered by 10 years ago

HA! He took it from my Custom Chat that's why its not loading he doesn't have a GUI that has a Frame inside to make it work that's why its killing you because its not a correct script.

He clearly just took it from my Script that I asked a question for

0
He took it but he changed some stuff up to make it that he made it and thats why its killing him EmperorF 0 — 10y
0
actually i took it from the wiki...and its not killing me. the game isnt loading my character VentusWind78 25 — 10y
1
It was taken from the Wiki. The script was created by Virtualdarks and improved by myself. Please do not make false claims. Articulating 1335 — 10y
0
Looks like mine EmperorF 0 — 10y

Answer this question