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

loop wont make part 1 invisible and part 2 visible and sometime's glitches??

Asked by 4 years ago
Edited 4 years ago

I've been trying for a day now, This seem's so simple but but it's so hard at the same time basically it cycle's through the folder (path) it makes model 1 invisible then model 2 visible model 2 invisible model 3 visible and so on, When it get's to the third model the fourth model is visible? This make's no sense ;'/

Basically when it get's to the third model the fourth model appear's too, And when i fix that the script doesn't loop correctly sorry if this is hard for you to understand i've tried simplifying it as much as i can

local current = 1
local path = workspace.path

local function invis(num,numm)
for i,v in pairs(path[numm]:GetChildren()) do
v.Transparency = num
end
end

local function nextt()
current = current + 1
invis(0,current)
end

while true do
wait(2)
if current < 3 then
invis(1,current)
nextt()
wait(2)
elseif current == 3 then
invis(0,4)
current = 1
wait(2)
invis(1,4)
end
end

Answer this question