Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make one script make another stop using _G?

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

1 answer

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);

This discussion is preserved as it was. New answers, comments, and votes are closed.