Because it runs both if statements.
if lol.CanCollide == true then
lol.Transparency = 1
lol.CanCollide = false
elseif lol.CanCollide == false then
lol.Transparency = 0
lol.CanCollide = true
end
We can make it more efficient since it will only be one or the other by switching to else:
if lol.CanCollide == true then
lol.Transparency = 1
lol.CanCollide = false
else
lol.Transparency = 0
lol.CanCollide = true
end
And lastly, since == returns either true or false, true==true kind of is unnecessary since CanCollide is already either true or false.
if lol.CanCollide then
lol.Transparency = 1
lol.CanCollide = false
else
lol.Transparency = 0
lol.CanCollide = true
end |