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

How to fix this script?

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

✓ Accepted answer

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

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