Hello.

I have a LocalScript in StarterGui that, when the Value property of a BoolValue in a Player changes to true, the Lighting service changes properties so that the Player can see in the dark (this is done locally, with the LocalScript, so only they can see in the dark), and vice versa.

But for some reason, I still can't see in the dark when the BoolValue's Value in my Player instance is true.

Here's my LocalScript:

repeat wait() until game.Players.LocalPlayer
local bool = game.Players.LocalPlayer:WaitForChild("IsAPug")

bool.Changed:Connect(function()
	if bool.Value == false then
		game.Lighting.Ambient = Color3.fromRGB(0, 0, 0)
		workspace.Terrain.WaterTransparency = 0.3
		workspace.Terrain.WaterReflectance = 1
	elseif bool.Value == true then
		game.Lighting.Ambient = Color3.fromRGB(255, 255, 255)
		workspace.Terrain.WaterTransparency = 1
		workspace.Terrain.WaterReflectance = 0
	end
end)

Help, please!

1 comment

0

Do bumps work on this site?