#Bug Code

1 messages · Page 1 of 1 (latest)

safe edge
#
local Part1 = game.Workspace.Part1
Part1.Transparency = 0

Part1.Touched:Connect(function(touched)
    while Part1.Transparency < 1 do
        Part1.Transparency += 0.1
        task.wait(0.1)
    end
    if Part1.Transparency == 1 then
        Part1.CanCollide = false
    end
end)

```Why does this not work??
warped canyon
#

try Part1.Transparency = Part1.Transparency + 0.1

ancient topaz
#

That does nothing lmao

warped canyon
#

thats worked for me when ive used that so idk

ancient topaz
#

Matter of fact its a longer way

#

Im not in studio so i cant do much and the code seems to be fine

#

Ah

#

I see it now

#

Move the if part.transparency == 1 in the while loop

#

And it should would

safe edge
#
local Part1 = game.Workspace.Part1
Part1.Transparency = 0

Part1.Touched:Connect(function()
    while Part1.Transparency < 1 do
        Part1.Transparency += 0.1
        task.wait(0.1)
    end
    if Part1.Transparency >= 1 then
        Part1.CanCollide = false
    end
end)

Part1.TouchEnded:Connect(function()
    while Part1.Transparency > 0 do
        Part1.Transparency -= 0.1
        task.wait(0.1)
    end
    if Part1.Transparency <= 0 then
        Part1.CanCollide = true
    end
end)