Hey Devforum,
Quick question, I’ve done this before but can’t seem to remember how I would like to change lighting settings once the game starts I just set up a quick thing for testing. I just want the light to change so I can edit the game in light but then the game will be dark when played. Here’s my code;
local lighting = game:GetService('Lighting')
game.Players.PlayerAdded:Connect(function()
lighting.Ambient = Color3.fromRGB(31, 37, 74)
end)
It should be a server script that executes on runtime, not when a player joins.
Sometimes studio misses playerAdded events.
local lighting = game:GetService('Lighting')
lighting.Ambient = Color3.fromRGB(31, 37, 74)
1 Like
Can you explain ‘runtime’? do you mean like server script service? I don’t know what service would execute runtime.
Runtime is just when everything executes, not waiting for a function. Every script will compile and run right away, making any changes you say like "print(“hello world”) but if you bind an event it will wait for that event to run that code.
Just have it in a script not in an event and it will run when you hit play, that’s all I meant.
1 Like