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

Issue with preloading decals. ?

I wish to preload some decals so they do not have to load when they are needed but beforehand so they come up instantly. I also wanted to disable the health, backpack and chat GUI's. None of this works. It is all in a localscript inside of StarterGui. What have I done wrong?

wait(.1)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.BackPack, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

Images = {154661376,154661390,154661404,154661415,154661431,154661453,154661473,152212548,152210708,154567083,154534470,154567321,154570980,154567343,154570977,154570974,154570968}
for i,v in pairs(Images) do
	game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. v)
end

4 comments

0

For reference, there is a closing bracket for my table, you just cannot see it.

0

Are you sure your images aren't being preloaded because it looks fine to me? Maybe it's the way that you are using the decals that is failing.

0

Oh wait, it could be because the numbers aren't strings.

0

If it's not that then I can't see any other problems.

1 answer

First of all, is this in a local script? I suggest not getting rid of you backpack, as this will remove the 123456789 tools on the bottom of your screen.Here's how you can write the removal of the core guis. I've seen that removal code in the questions and it doesn't work. Try the below code instead it will work.

game.StarterGui:SetCoreGuiEnabled("Health",false)

As for the image, im pretty certain the only way you can use the preload function is with ipairs, not pairs. The EXACT code is on the wiki, so check it out.

3 comments

0

It's in a LocalScript (as stated). It would make no difference whether I used ipairs or pairs as ipairs iterate until the first nil whereas pairs iterate to the last index of the table . I will give your new code for disabling core gui's a go. Thankyou.

0

UPDATE: Tried your method, still nothing. Tried ipairs, nothing there either. Maybe it's my script location: http://puu.sh/8lfZ7.png

0

Im not sure if your still having this problem, but i took a break from roblox and recently came back. I did the exact same thing as i did before to remove my core gui, and now it doesnt work!

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