Create a udev rule on /etc/udev/rules.d/99-scrolllock.rules with this content:
SUBSYSTEM=="leds", KERNEL=="input*::scrolllock", RUN+="/bin/chmod 777 /sys/class/leds/%k/brightness"
After, create a file on .local/bin/led (or other directory for your scripts), and put this content:
#!/bin/bash