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

How to fix this script?

Asked by 10 years ago

Everytime this script runs, it makes the mesh completely invisible for a split second. I was wanting to know if there was a way to make this stay opaque the whole time, and not flash.

while true do
    wait(0.001)
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=11597751"
    wait(0.001)
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=115975859"
    wait(0.001)
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=115973891"
end

1 answer

Log in to vote
3
Answered by
Vathriel 510 Moderation Voter
10 years ago

Use preload! The reason for using preload is that roblox normally doesn't load objects until the object is actually put into use. By using preload we are able to load things first so that appear more smoothly. This can also be done with sounds, and I'm sure a few other assets ingame.

Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=11597751")
Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=115975859")
Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=115973891")
while wait() do
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=11597751"
    wait()
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=115975859"
    wait()
    script.Parent.MeshId = "http://www.roblox.com/asset/?id=115973891"
end
Ad

Answer this question