I don’t know why but this for loop stops at some point and doesn’t make some parts change.
this is a local script btw in starter player scripts
task.wait(1)
local NVParts = game.Workspace.NightVisionParts
local function Trans()
for i, v in NVParts:GetChildren() do
if v.Transparency == 1 then
for _, t in v:GetChildren() do
t.Transparency = .8
end
end
end
end
while true do
Trans()
task.wait(0.5)
end
I just tried tweaking the script and this is what I got, works fine in studio but not in roblox.
task.wait(3)
local NVParts = game.Workspace.NightVisionParts
local function Trans()
for i, v in NVParts:GetChildren() do
if v.Transparency == 1 then
for _, t in v:GetChildren() do
t.Transparency = .8
end
end
end
wait(.01)
end
while true do
Trans()
task.wait(1)
end
My reply wasn’t meant to be the solution itself - You will probably want to turn streaming back on. Basically, Streaming Enabled means that the objects in the game are unloaded if the player is too far away from them, and loaded when it is close to the player. The reason it was causing issues for you is that it is unloading things which you want loaded.
A simple fix would be to turn streaming enabled back on and, assuming NVParts is a model, set the streaming behaviour of it to Atomic (which means everything in it is either loaded or unloaded together.)