I finished making this script for my obby-style game that makes a part fade away after it has been touched (and regen a few seconds later) for an additional challenge. Later on, I realized that players could essentially make sections of levels unbeatable by repeatedly activating the disappearing script. Making it local would be the perfect fix but I’m not sure how I would go about doing it. Any help would be greatly appreciated!
Video demonstration: Screen Recording 2022-01-03 at 6.45.38 PM
if isTouched == false then
gravel.Transparency = 0.1
texture.Transparency = 0.1
isTouched = true
wait(0.2)
gravel.Transparency = 0.2
texture.Transparency = 0.2
wait(0.2)
gravel.Transparency = 0.3
texture.Transparency = 0.3
wait(0.2)
gravel.Transparency = 0.4
texture.Transparency = 0.4
wait(0.2)
gravel.Transparency = 0.5
texture.Transparency = 0.5
wait(0.2)
gravel.Transparency = 0.6
texture.Transparency = 0.6
wait(0.2)
gravel.Transparency = 0.7
texture.Transparency = 0.7
wait(0.2)
gravel.Transparency = 0.8
texture.Transparency = 0.8
wait(0.2)
gravel.Transparency = 0.9
texture.Transparency = 0.9
wait(0.2)
gravel.Transparency = 1
texture.Transparency = 1
gravel.CanCollide = false
wait(5)
gravel.Transparency = 0
texture.Transparency = 0
gravel.CanCollide = true
isTouched = false
end
end
gravel.Touched:connect(PlayerTouched)