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

How do I make my replacement loadscreen have an image?

script.Parent:RemoveDefaultLoadingScreen()
 
local screen = Instance.new("ScreenGui")
screen.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
 
local textLabel = Instance.new("TextLabel")
textLabel.Parent = screen
textLabel.Text = "Loading"
textLabel.Size = UDim2.new(1,0,1,0)
textLabel.FontSize = Enum.FontSize.Size14

local imagelabel = Instance.new ("ImageLabel")
imagelabel. image =  "rbxgameasset://Images/Pickaxe"
imagelabel. Position = {0.5, -50},{0.5, -50}
imagelabel. Size = {0, 100},{0, 100}
 
local count = 0
while game.ContentProvider.RequestQueueSize > 0  do
	textLabel.Text = "Loading "
	for i=1,count do
		textLabel.Text = textLabel.Text .. "."
	end	
	count = (count + 1) % 4
	wait(.3) 
end
 
screen.Parent = nil

This is what I have so far. I get the text, but not the image? Anyone know what to do? (this is in ReplicatedFirst)

2 comments

0

try already having yhr image in ReplicatedFirst and wat for it?

0

You need a capital I for image. You had a lowercase one.

2 answers

Here's a fix!

script.Parent:RemoveDefaultLoadingScreen()

local screen = Instance.new("ScreenGui")
screen.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local textLabel = Instance.new("TextLabel")
textLabel.Parent = screen
textLabel.Text = "Loading"
textLabel.Size = UDim2.new(1,0,1,0)
textLabel.FontSize = Enum.FontSize.Size14

local imagelabel = Instance.new ("ImageLabel")
imagelabel. image =  "rbxgameasset://Images/Pickaxe"
imagelabel. Position = UDim2.new(.5,-50,.5,-50)
imagelabel. Size = UDim2.new(0,100,0,100)

local count = 0
while game.ContentProvider.RequestQueueSize > 0  do
    textLabel.Text = "Loading "
    for i=1,count do
        textLabel.Text = textLabel.Text .. "."
    end 
    count = (count + 1) % 4
    wait(.3) 
end

screen.Parent = nil

1 comment

0

Please explain your changes.

This method is something i tested myself. My theory is that new Images dont work with loading screens.

Just put a new image instance into ReplicatedFirst!

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
script.Parent:RemoveDefaultLoadingScreen()

local screen = Instance.new("ScreenGui")
screen.Parent = PlayerGui

local frame = Instance.new("Frame",screen)
frame.Size = UDim2.new(1,0,1,0)
frame.ZIndex = 1 -- The layer the image appears on

local textLabel = Instance.new("TextLabel",screen)
textLabel.Text = "Loading"
textLabel.Size = UDim2.new(1,0,1,0)
textLabel.FontSize = Enum.FontSize.Size14
textLabel.BackgroundTransparency = 1 -- So the frame can be seen
textLabel.ZIndex = 3

game.ReplicatedFirst:WaitForChild("ImageLabel"):Clone().Parent = screen
--Note: use http://www.roblox.com/asset/?id=ID, not what you did
--Put the label in ReplicatedFirst
--Experiment with ZIndex

local count = 0
while game.ContentProvider.RequestQueueSize > 0  do
    textLabel.Text = "Loading "
    for i=1,count do
        textLabel.Text = textLabel.Text .. "."
    end 
    count = (count + 1) % 4
    wait(.3) 
end

screen.Parent = nil

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