In my game, one player is chosen as a "beast" every round and makes lights flicker when near them. I've tried putting invisible parts on the floor scripted with touched events; while it does work, it's really time consuming and non-efficient. So basically my question is: How do I detect when a player in a certain team goes near a SpotLight, PointLight, etc.. and make it do something afterwards?
Things to look up on;
The plan is to make a localscript that is copied and parented to the player if they're ever on the team needed for this effect to work (or just use :GetPropertyChangedSignal() as I stated), and use either Magnitude or :GetPartsInPart() to determine if they're close enough to the lights in order to initiate the light flicker effect. This is where tweenservice comes in and you can mess around with the easing styles and seconds it takes to tween and whatnot, here is a link to how the different easing styles look (keep in mind InOut
is also a thing).
With this in mind I wish you luck in being able to pull off this flickering light effect. :) (if you want it to dimmer down then TweenService is good to use, if you want it to just straight turn off I recommended making a NEW variable checking if there's at least one person inside the given Magnitude or :GetPartsInPart() field and loop it until they're not in those given areas anymore. I hope this helps in your crusade to making this mechanic work ingame :3 if this indeed helped you then please consider marking this as the answer of which helped you. Good evening!