Is there a way to make a script function multiple times upon disabling/enabling it?

Is there a way to make it so a script functions multiple times upon enabling it?

Basically what I’m trying to get at is,

say I have a script, and inside of it the code says print("Hello World!"), which is the default line that comes with the script,

when you run the game, it’ll print it, but if I disable it with another script, and renable it, it won’t reprint it, is there a way to make it so if a script gets enabled after being disabled (since it already printed “Hello World!”), it’ll print it again?

What would be the purpose for this?
You could just do that process (or whatever else) in the other script using a function.

1 Like

maybe like this eH

--Trigger

while wait() do
	print("yes")
	
	if TRIGGER ==..... then
		break
	end
	
end
1 Like

Unless I misunderstood the question, this is an intended behavior, by default when a script gets toggled off and on it runs the script context. Perhaps your issue may be caused by something else?

1 Like

in my situation, my thing won’t load like I want it to do, and its making me confused just like how I’m confusing everyone

nvm, I figured it out, thanks.