local FB = script.Parent
game.Workspace.AssetPack.DisappearingBlock.Touched:Connect(function()
local FTran = FB.Transparency
while FTran < 1 do
task.wait(0.2)
local FTran = FB.Transparency
FTran = FTran + 0.1
print("Trans Decreased")
end
if FTran == 1 then
FB.CanCollide = false
FB.CanTouch = false
end
end)
#Transparency not looping
38 messages · Page 1 of 1 (latest)
u addet 2 same variables
so can i define fb in the thing
u alr defined it 1 time
no like
game.Workspace.AssetPack.FB.Touched:Connect(function()
instead of game.Workspace.AssetPack.DisappearingBlock.Touched:Connect(function()
@patent sundial
ye
u mean Ftran?
ye inside the while loop
local FB = script.Parent
FB.Touched:Connect(function()
while FB.Transparency < 1 do
task.wait(0.2)
FB.Transparency = FB.Transparency + 0.1
print("Trans Decreased")
end
if FB.Transparency == 1 then
FB.CanCollide = false
FB.CanTouch = false
end
end)
smthing like this?
oh it works
Oh
If u want to acces it again for some reason
u do the same thing
without the local
if FB.Transparency == 1 then
FB.CanCollide = false
FB.CanTouch = false
end
game.Workspace.AssetPack.DisappearingBlock.Touched:Connect(function()
local FTran = FB.Transparency
while FTran < 1 do
task.wait(0.2)
local FTran = FB.Transparency
FTran = FTran + 0.1
print("Trans Decreased")
end
FB.CanCollide = false
FB.CanTouch = false
end)
like this
just wondering why cant we keep the if statement
cuz the while loop wont stop till the transparecy is 1 anyway
maybe its glitching it
just test it
thx
works?
yep