I know what global function is but i dont know how to use it to make a script make another one stop or start running
Just check before doing anything.
If you have a function with some constant loop, you can check that the global variable says it's okay:
while wait(1) do if _G.okay then -- Do whatever end end
Similarly, for any events that you have going on.
function onTouched(hit) if _G.okay then -- Do whatever end end blah.Touched:connect(onTouched);