Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FilteringEnabled fog no errors ?

No clue whats wrong to be 100% honest, no errors or anything.

game.ReplicatedStorage.Fog.OnServerEvent:Connect(function()
	local fogcolor = {67, 67, 67} -- change to the color you want it to be lmao
	local fogend = 50 -- change to the amount of fog end you want
	local fogstart = 0 -- change to the amount of fog start you want
	
game.Lighting.FogColor = fogcolor
game.Lighting.FogEnd = fogend
game.Lighting.FogStart = fogstart
end)

2 comments

0

Where is this script located?

0

Regular script is located in workspace. Local script is located within ServerScriptService

1 answer

✓ Accepted answer

Here's the problem. You cannot put LocalScripts inside of the server script service as they will not function. Also, you were missing Color3.new on line 2.
LocalScript in StarterGui:

local re = game:GetService("ReplicatedStorage").RemoteEvent --wherever your event is
re:FireServer() --FireServer can only be used in the Client

Server Script in ServerScriptService:

local re = game:GetService("ReplicatedStorage").RemoteEvent
re.OnServerEvent:Connect(function() --OnServerEvent can only be used in the Server
local fogcolor = Color3.new(67/255,67/255,67/255)
local fogend = 50 
local fogstart = 0 -
game.Lighting.FogColor = fogcolor
game.Lighting.FogEnd = fogend
game.Lighting.FogStart = fogstart
end)

Please accept my answer if this helped!

The reason why the LocalScript is in the StarterGui is because LocalScripts cannot function in services like the workspace, serverscriptservice, etc. They can only run in client-based services like PlayerGui, StarterGui, StarterPack, etc.

1 comment

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.