You can write your topic however you want, but you need to answer these questions:
-
**I want it to work for all parts in the folder
-
**It works for one part, and none of the others
-
**I have tried two different methods ill post below
fogparts = {} -- do not mess with this this will be the amount of parts touched to turn on fog
for i,v in pairs(game.Workspace.FogParts:GetChildren()) do
table.insert(fogparts,v)
end
plyr = game.Players.LocalPlayer
tdn = false -- do not mess with this
repeat wait() until plyr.Character --- dont mess with this or anything aboce
char = plyr.Character -- dont mess with this
hr = char:WaitForChild("HumanoidRootPart") -- dont mess with this
print("yes")
lighting = game:GetService("Lighting") --- dont mess with this
atmos = lighting:WaitForChild("Atmosphere") -- dont mess with this
--Stuff you can change below --
print("getting")
origdens = atmos.Density
orighaze = atmos.Haze
origglare = atmos.Glare
origName = atmos.Name
newdens = 0.5
newhaze = 9
newglare = atmos.Glare
newName = atmos.Name
while wait() do
for i,v in pairs(fogparts) do
if (v.Size.Z / 2) >= (hr.Position - v.Position).Magnitude or (v.Size.X / 2) >= (hr.Position - v.Position).Magnitude or (v.Size.Y / 2) >= (hr.Position - v.Position).Magnitude then
atmos.Color = Color3.fromRGB(124, 170, 113)
atmos.Decay = Color3.fromRGB(181, 214, 16)
atmos.Density = newdens
atmos.Glare = newglare
atmos.Haze = newhaze
atmos.Name = newName
print("fog")
else
print("nofog")
atmos.Color = Color3.fromRGB(199, 170, 107)
atmos.Decay = Color3.fromRGB(92, 60, 13)
atmos.Density = origdens
atmos.Glare = origglare
atmos.Name = origName
atmos.Haze = orighaze
end
end
end
fogparts = {} -- do not mess with this this will be the amount of parts touched to turn on fog
for i,v in pairs(game.Workspace.FogParts:GetChildren()) do
table.insert(fogparts,v)
end
plyr = game.Players.LocalPlayer
tdn = false -- do not mess with this
repeat wait() until plyr.Character --- dont mess with this or anything aboce
char = plyr.Character -- dont mess with this
hr = char:WaitForChild("HumanoidRootPart") -- dont mess with this
print("yes")
lighting = game:GetService("Lighting") --- dont mess with this
atmos = lighting:WaitForChild("Atmosphere") -- dont mess with this
--Stuff you can change below --
print("getting")
origdens = atmos.Density
orighaze = atmos.Haze
origglare = atmos.Glare
origName = atmos.Name
newdens = 0.5
newhaze = 9
newglare = atmos.Glare
newName = atmos.Name
for i=1,#fogparts do
print(fogparts[i])
end
for i=1,#fogparts do
function CheckMag(v)
wait()
while wait() do
if (v.Size.Z / 2) >= (hr.Position - v.Position).Magnitude or (v.Size.X / 2) >= (hr.Position - v.Position).Magnitude or (v.Size.Y / 2) >= (hr.Position - v.Position).Magnitude then
atmos.Color = Color3.fromRGB(124, 170, 113)
atmos.Decay = Color3.fromRGB(181, 214, 16)
atmos.Density = newdens
atmos.Glare = newglare
atmos.Haze = newhaze
atmos.Name = newName
print("fog")
else
atmos.Color = Color3.fromRGB(199, 170, 107)
atmos.Decay = Color3.fromRGB(92, 60, 13)
atmos.Density = origdens
atmos.Glare = origglare
atmos.Name = origName
atmos.Haze = orighaze
end
end
end
CheckMag(fogparts[i])
end
```
Please do not ask people to write entire scripts or design entire systems for you. If you can't answer the three questions above, you should probably pick a different category.