Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script preventing character from loading?

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

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

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

try this

repeat 
wait()
until player

1 comment

0

It's in a PlayerAdded event

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

4 comments

0

He took it but he changed some stuff up to make it that he made it and thats why its killing him

0

actually i took it from the wiki...and its not killing me. the game isnt loading my character

1

It was taken from the Wiki. The script was created by Virtualdarks and improved by myself. Please do not make false claims.

0

Looks like mine

This discussion is preserved as it was. New answers, comments, and votes are closed.