How to stop script until BindableEvent.Event?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I need to pause script until BindableEvent.Event and then check arguments

  2. What is the issue? My attempt to do this failed

  3. What solutions have you tried so far? Searching on devforum and reading documentation

local BindableEvent = game:GetService("ServerStorage"):WaitForChild("Event")

BindableEvent.Event:Wait()
BindableEvent.Event:Connect(function(Key)
	if Key == 123 then
		print(123)
	elseif Key == 456 then
		print(456)
	end
end)

print(789)

After BindableEvent fire it only prints 789

task.wait(3)

local BindableEvent = game:GetService("ServerStorage"):WaitForChild("Event")
BindableEvent:Fire(123)

RBXScriptSignal:Wait

local key = BindableEvent.Event:Wait()
print(key)

might not be working because u r firing from client to server or server to client. Bindable events dont communicate between client and server.