Signal/Event not firing?

hello guys, I’ve been using @Quenty’s Signal module for making custom RBXScriptSignals for my work

but it seems like this isn’t firing while I already fired the event

Codes

function (inside my ModuleScript):

function new:ForceChat(player)
	self.Typing:Fire(player) -- the function I used to fire the event
	Objects.ForceChat:FireClient(player) -- fires the RemoteEvent
	print("fired") -- confirmation, it printed
end

Script (I used it to invoke the function above):

game.ReplicatedStorage.ServerAccess.Server.OnServerEvent:Connect(function(player)
	local Module = require(game.ReplicatedStorage.ChatClass) -- require the module so I can use it
	
	Module.new():ForceChat(player) -- invokes the function above
	print("invoked") -- confirmation, it printed
end)

Script (I used it to confirm if the event fires or not, it didn’t print):

local Module = require(game.ReplicatedStorage.ChatClass) -- requires the module so I can use it

local Event = Module.new() -- creates a table so I can use the event

Event.Typing:Connect(function(player) -- an event named "Typing" which I fired earlier
	print(player.Name, "is typing!") -- confirmation, it didn't print
end)

and yet no errors

you can ask me to give the full code of the module

I would appreciate if anyone could help me get over this :slight_smile:

Event.Typing won’t work because it’s an empty table. But I see that they are both server scripts so why can’t you just use the same server script?

1 Like

no no no

image

idk what do you want to achieve

1 Like

You’re creating a new object here (assuming you’re using oop) but you have no way to get that object outside of the script. Assuming the Typing event is part of that object you created, you have no way of calling the bindable from that specific object. You will need to find another way to get the same bindableEvent in both scripts.

3 Likes

thanks! (btw I’m not using a BindableEvent)

_G.ChatClass.Typing:Connect(function(player)
	print(player.Name, "is typing!")
end)
local Module = require(game.ReplicatedStorage.ChatClass)
local Chat = Module.new()

_G.ChatClass = Chat

game.ReplicatedStorage.ServerAccess.Server.OnServerEvent:Connect(function(player)
	Chat:ForceChat(player)
	print("created")
end)
2 Likes