You can write your topic however you want, but you need to answer these questions:
Im trying to make this code more efficient but I dont know how.
for i = 10,0,-1 do
script.Parent.Text = i
wait(1)
end
script.Parent.Text = "The border has opened!!"
game.Workspace.MiniGameBorder.CanCollide = false
game.Workspace.MiniGameBorder.Transparency = 1
game.Workspace.MiniGameBorder1.CanCollide = false
game.Workspace.MiniGameBorder1.Transparency = 1
game.Workspace.MiniGameBorder2.CanCollide = false
game.Workspace.MiniGameBorder2.Transparency = 1
I tried to make it into a folder and change the property of the children’s of the folder but it doesnt seem to work.
just add them to a table and loop through it. Like this:
for i = 10,0,-1 do
script.Parent.Text = i
wait(1)
end
script.Parent.Text = "The border has opened!!"
local borders = {game.Workspace.MiniGameBorder, game.Workspace.MiniGameBorder1, game.Workspace.MiniGameBorder2}
for i,v in pairs(borders) do
v.CanCollide = false
v.Transparency = 1
end
for i = 10, 0, -1 do
script.Parent.Text = i
task.wait(1)
end
local borders = {workspace.MiniGameBorder, workspace.MiniGameBorder1, workspace.MiniGameBorder2}
for _, border in ipairs(borders) do
border.CanCollide = false
border.Transparency = 1
end
script.Parent.Text = "The border has opened!!"