I’m trying to make it where when the clock time is at a certain time, the ambience changes. I also am trying to make it where when a certain part is touched, the player who touches it’s ambience changes, only that player. I’ve tried many solutions that just don’t work, please help me out if you can!
Essentially I wanna make it where there is 2 zones, each zone has a separate ambience which also changes with time.
LocalScripts (or client scripts) will only run client-side. This means that any changes done via a LocalScript will only appear for that client/player. I would recommend having a single LocalScript handle the time and ambience.
This isn’t exactly what you want, but here’s something from another thread from the other day:
It’s to play a sound depending on the time of day. However, you may want more dynamic ambience that changes more accurately based on the time of day.
If you just want to have two set times with no day/night cycle, you can just have the touch event change the time and ambience once (still using a LocalScript).
Where would this script go in the toolbox?
The script I posted isn’t exactly what you’re looking for, but it’ll work in both a server or client script. But for your use case, it would be done in a LocalScript. LocalScripts can only run inside of a client object. This includes anywhere inside the player (such as StarterPlayerScripts) or the player’s character (such as StarterCharacterScripts).