You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to make be able to set the ambient from three TextButtons on a PlayerGui (R, G, and B respectively)
- What is the issue? Include screenshots / videos if possible!
For whatever reason, i cannot deduce why when i fire the button it changes the ambient to 0,0,0 or no change at all regardless of the input in R,G,B.
Could it be that im using an entirely WRONG method?
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Ive looked at a lot of posts regarding this topic and haven’t found anything that solves my problem, and I myself have tried this on a local and server script, same problem (but needed on server script otherwise it will only show for the client)
local re = script.Parent.ChangeEv
local lighting = game:GetService("Lighting")
re.OnServerEvent:Connect(function(player)
local r = tonumber(player.PlayerGui.ChangeAmbient.Background.R.Text)
local g = tonumber(player.PlayerGui.ChangeAmbient.Background.G.Text)
local b = tonumber(player.PlayerGui.ChangeAmbient.Background.B.Text)
lighting.Ambient = Color3.new(r,g,b)
print("ambient changed to "..lighting.Ambient.R, lighting.Ambient.G, lighting.Ambient.B, "by ".. player.Name)
end)
If any further clarification is needed, please reply asking for me to do so.
GIF of what exactly is happening:
for some reason, the print still works. I’m clueless, but then again i’m also not a scripter.