So this is the server script,
local AmbientChanger = workspace.AmbientChanger
debounce = false
AmbientChanger.Touched:Connect(function(hit)
print("Touched!")
if not debounce and hit.Parent:FindFirstChild("Humanoid") then
debounce = true
workspace.RemoteEvents.AmbientChangerEvent:FireClient()
end
debounce = false
end)
while this is the local script, which is in the RemoteEvent
script.Parent.OnClientEvent:Connect(function()
print("Recieved!")
if game.Lighting.FogEnd == 100000 then
for i = -1000, 100000, 500 do
game.Lighting.FogEnd = i
game.Lighting.FogColor = Color3.new(255, 255, 255)
end
else
for i = 1000, 500, 100000 do
game.Lighting.FogEnd = i
end
end
end)
It doesn't even seem to detect that the brick is getting touched though, and I can't figure out why. FilteringEnabled is on.

1 comment
the for loop on lines 12 through 15 doesn't work and the increment(100000) is greater than the absolute value of 500-1000