hey,
im making an obby game but the for loop never runs even though there is a valid folder in workspace and it has the correct name and all.
ive even rewrote the for loop by hand and it still doesnt work.
local player = game.Players.LocalPlayer
print('HIYA')
local function togglePlatformVisibility(platform, visible)
if platform:IsA("BasePart") then
print('ooo its a basepart')
platform.Transparency = visible and 0 or 1
platform.CanCollide = visible
print('DONE!')
end
end
print('yipeee')
local function handlePlatform(platform)
local config = platform:FindFirstChild("Settings")
if not config then
warn("Platform " .. platform.Name .. " is missing a Settings Configuration!")
return
end
print('heuyeyey')
local disappearingTime = config:GetAttribute("disappearingTime") or 3 --default
local reappearingTime = config:GetAttribute("reappearingTime") or 5 --default
task.spawn(function()
print("spawned func")
while true do
togglePlatformVisibility(platform, true)
task.wait(reappearingTime)
togglePlatformVisibility(platform, false)
task.wait(disappearingTime)
end
end)
end
print('done with both functions!!!11')
local fadingPlatformsFolder = workspace:WaitForChild("FadingPlatforms", 5)
if fadingPlatformsFolder then
print('found the folder lmao')
for i, v in pairs(fadingPlatformsFolder:GetChildren()) do
print("HEY")
if v:IsA("BasePart") then
print('omg its a basepart')
handlePlatform(v)
print("SENT FUNCTION WOOOOOOOO")
end
end
else
warn("FadingPlatforms folder not found in workspace!")
end
(for loop near the end)
it prints “found the folder lmao” and nothing past that