I’m currently making a disappearing block system. It’s very simple, if you step on a block it will disappear, then reappear. The problem I’m having is that I don’t want an individual script in each block making it disappear.
The solution I found was to use the in pairs loop but the problem with this is that since there are a few wait() in the code, the table doesn’t loop until the first block that I stepped on disappears and reappears. But I need the blocks to continuously be disappearing as you step on them.
Here is the code I have so far:
local plateform = game.Workspace.DisapearingPlateforms:GetChildren()
local isTouched = false
for _, part in pairs(plateform) do
if part:IsA("Part") then
part.Touched:Connect(function(plr)
if plr.Parent:FindFirstChild("Humanoid") then
if not isTouched then
isTouched = true
for count = 1, 10 do
part.Transparency = count / 10
wait(0.1)
end
part.CanCollide = false
wait(3)
part.Transparency = 0
part.CanCollide = true
isTouched = false
end
end
end)
end
end
I am a beginner scripter so if the solution is very simple, or if there is no solution at all, I’m very sorry for waisting your time. Any help is appreciated.