in my game when i test it it goes all white, so i maked a script to fix the ambient to make it normal in a gui. but it doesen't work, i don't see nothing in the output about the script
local Lighty = game.Lighting.Ambient script.Parent.MouseButton1Down:Connect(function() if Lighty == Color3.fromRGB(25500, 25500, 25500) then print("fixi") Lighty = Color3.fromRGB(255,255,255) end end)
Nvm i got it
You have the fromRGB values incorrect, the maximum RGB values are 255 and 0 as the minimum. Try this and see if it works
local Lighty = game.Lighting.Ambient script.Parent.MouseButton1Down:Connect(function() if Lighty == Color3.fromRGB(255, 255, 255) then print("fixi") Lighty = Color3.fromRGB(255,255,255) end end)
Lighty
variable is a reference to the actual property of Lighting
. If the ambient of Lighting
changes, the variables you have defined won't update; only its Ambient
property will change. In order to fix this, you can remove the Lighty
variable and only make direct accesses to the Ambient
property of Lighting
. You could also modify the variables to hold Lighting
itself.local Lighting = game:GetService("Lighting") script.Parent.Activated:Connect(function(inputObject if Lighting.Ambient == Color3.fromRGB(255, 255, 255) then print("fixi") Lighting.Ambient = Color3.fromRGB(255,255,255) end end)