✓ Accepted answer
The reason is because you're not actually setting the CanCollide as a specific property of a part.
Additionally, although it isn't an error, rather than doing division when setting transparency, you can set the index increase value as a third reference.
To fix the original problem(s), you can add a reference as such:
local this = script.Parent
while (true) do
for i=0, 10 do
this.Transparency = i/10 then
this.CanCollide = true
wait(0.1)
end
for i=10, 0, -1 do
this.Transparency = i/10
wait(0.1)
end
end
Also, if you'd like to not use division when doing this, you can do:
local this = script.Parent
while (true) do
for i=0, 1,.1 do
this.Transparency = i then
this.CanCollide = true
wait(0.1)
end
for i=1, 0, -.1 do
this.Transparency = i
wait(0.1)
end
end
1 comment
Omg thx I forgot to put "this.CanCollide"