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

Issue with preloading decals. ?

Asked by 10 years ago

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
0
For reference, there is a closing bracket for my table, you just cannot see it. crackabottle123 110 — 10y
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. Archonious2 160 — 10y
0
Oh wait, it could be because the numbers aren't strings. Archonious2 160 — 10y
0
If it's not that then I can't see any other problems. Archonious2 160 — 10y

1 answer

Log in to vote
0
Answered by
LevelKap 114
10 years ago

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.

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. crackabottle123 110 — 10y
0
UPDATE: Tried your method, still nothing. Tried ipairs, nothing there either. Maybe it's my script location: http://puu.sh/8lfZ7.png crackabottle123 110 — 10y
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! LevelKap 114 — 10y
Ad

Answer this question