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

How do I make my replacement loadscreen have an image?

Asked by 8 years ago
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)

0
try already having yhr image in ReplicatedFirst and wat for it? bubbaman73 143 — 8y
0
You need a capital I for image. You had a lowercase one. fishguy100 135 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

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

0
Please explain your changes. M39a9am3R 3210 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

Answer this question