Thanks, it works well, but i tried incorporating this into the skript i needed, yet it went pretty badly wrong. My idea is if the player is at spawn, they wont get hurt by the damage, but if they are outside of spawn, they do. For my example i used right clicking on bedrock just for testing. (Please forgive me im new to skript at the moment)
on right click with bedrock:
if {Nosprintdamage} is false:
set {Nosprintdamage} to true
else:
set {Nosprintdamage} to false
if {Nosprintdamage} is false:
every 2 seconds:
damage all players by 2 where [input is not sprinting]