Detecting when a RBXScriptSignal fires

Hi all,
I was wondering how I could detect when an RBXScriptSignal from an event fires.
I’ve read over the roblox documentation on the RBXScriptSignals, but none of the functions that exist currently match what I’m looking for; here’s my code (and comments listing what I want it to do)

	entity.Humanoid:MoveTo(entityBlock.Position) --moveTo function; should fire the MoveToFinished event signal when done
	
	repeat
		locatePlayers() --irrelevant function
		task.wait(0.01)
	until entity.Humanoid.MoveToFinished --I could be wrong, but the script could be interpreting this as true, and because true = true, the code inside the loop never runs. regardless whether my previous attempted explanation is correct, this loop doesn't loop as intended.

Any advice will be greatly appreciated, thank you!

Use signal:Wait(), it will yield the code and wait for the event to fire once before continuing. It returns the value that the event returns.

2 Likes

Thanks for the solution, it worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.