Distance detector changing light intensity

I need to create a spot light that changes its intensity when the character come closer to the light.

There are several ways of achieving such an effect, depends on what you’re looking to achieve exactly -
But you basically need to create a new Actor blueprint, add the spotlight component to it, then control its Intensity value programmatically - either by always checking the distance from the player (most accurate, probably very costly), or by using a trigger volume that turns this effect on and off (according to whatever conditions you set along with the trigger box’s overlap events).

Then you’ll have a segment connected to the event graph’s EventTick, that checks whether the character is in range or not (let’s call that ‘isInRange’); if it is - then the intensity should rise (up to a maximal value - experiment with it!) according to the character’s distance from the light (and fall back to its minimal, default value when the player leaves the trigger area).
You’d also have overlap events for your trigger volume (begin & end), in which you should check if the overlapping actor is the relevant character - then control the ‘isInRange’ condition accordingly.

For anything more specific - I’d start off by watching a few short video tutorials about using blueprints in UE4, since I’ve seen the specific topic of controlling lights being used more than once in the most basic ones.
After that you can probably get something going & upload blueprint screenshots for further support as required, but I doubt anyone will provide a full-on step-by-step in text (especially since we’re dealing with a subject that’s already pretty well-covered online).