Hi Birb,
To make a script more efficient, you need to make sure you don't repeat yourself. Also, try to minimize the amount of time you run the loop for. So, try to hesitate using infinite loops and such like the one you're using. I would recommend just running through all of the frames and then manipulating their properties.
###I'd recommend storing all of the frames in a folder or something so that they're all in one place and you can just make a table by getting the children of the folder, rather than searching for each one.
####If I were to make your script smaller and more efficient, it would look something like this:
local frames = script.Parent:WaitForChild("Frames Folder"):GetChildren();
local function change_props(obj, initial_props, end_props, t)
for name, prop in next, initial_props do
obj[name] = prop;
end
wait(t)
for name, prop in next, end_props do
obj[name] = prop;
end
end
for i = 1, #frames do
local object = frames[i];
local initialize_props = {
["Transparency"] = 1;
["CanCollide"] = false;
}
local end_props = {
["Transparency"] = 0;
["CanCollide"] = true;
}
local t = 0.2;
change_props(object, initialize_props, end_props, t);
end
##Hope I helped and have a wonderful day/night.
Thanks,
Best regards,
~~ KingLoneCat
1 comment
if you are using math.huge why don't you just use a while true do loop?