Bindable Event never fires

I have a module script that creates an object with a bindable event attached to it.
The bindable event, however, doesn’t seem to fire.

--other stuff

local FinishedEvent = Instance.new("BindableEvent")

local DialogueObject ={
		Message = Msg,
		Speaker = SpeakerName,
		Image = SpeakerImage,
		TypeSpeed = TypeSpeed,
		CloseDelay = CloseDelay,
		Finished = FinishedEvent.Event
	}

function DialogueObject:Run(Player)
--blah
wait(self.CloseDelay)
FinishedEvent:Fire()
--stuff
end

Do you have your bindable event parented? Accepting signals most often requires the event existing in game.

If this is a module script, you also have to require it using a classical server or local script.

Not necessarily, as long as it’s a module script or the event is in the same script, you can detect it whether or not it’s parented to something. I use that all the time

Perhaps, but why would you need to accept signals from the same script? Those are relatively rare occasions and there are often better, performance friendlier workarounds.

Didn’t seem to work for me, nothing had changed.

You could use it for custom OOP classes

1 Like

Where does the function first connect from? You could also add print() statements if all doesn’t work

1 Like

Try restructuring this to

Dialogue = DialogueModule:Create("Landing successful. You may now get up.","E-Assistant",285582551)

-- the function yields the thread and the event fires before it's able to get to it
coroutine.wrap(function()
  Dialogue:Run(Player)
end)()

Dialogue.Finished:Wait()

or

Dialogue = DialogueModule:Create("Landing successful. You may now get up.","E-Assistant",285582551)
coroutine.wrap(Dialogue.Run)(Dialouge, Player)

Dialogue.Finished:Wait()

(which ever one works)

It seems to have worked, I’m getting the message in the output, though the dialogue thats supposed to appear afterward doesn’t pop up, but thats probably some unrelated error on my part.

Edit: It is, I was setting the box to be invisible right after the event fired to make it appear