How can I find which remote event fired?

I can’t for the life of me figure out how to get which remote event fired in which door.
This is all I’ve got so far in my module script

local Doors = {}
-- Variables
local obj = nil

Doors.Func = function()
	for _,Door in pairs(game.workspace.House.Interactive.Door:GetChildren()) do
		obj = nil --?? I need to find the parent of the event (The door model) so I can access my bool and my event 
	end
end

return Doors

image
There are multiple doors, I’m just showing one because all the others are the same

Basically all I need to figure out is what event fired in what door.

I have a whole other script that fires the event so that’s fine.

Try adding print(eventname) into the different remote events and see which ones print which.

1 Like

Its prints all of them and they have the same name

1 Like

Change the name and connect them to different actions. Make sure the events are trying to fire seperarely.

1 Like

My main script that fires the event only fires the the event inside the door my mouse is over. I kept all the Events named the same so I didn’t have to rewrite the code a billion times. all I need is to find what event was fired in what door. If I changed all the names, only one of the doors would work.

But if you don’t have the doors named what good is knowing which door has had the event fired in it?

You could put a bool value into each door and have a serial number that’s different in each door to give an indication of which door has had the event fired, then you could check each door to see if it has that serial number, but would that really be different than naming each door and firing the event on the script.Parent instead of having it named Door in the script.

1 Like

That’s close to my current solution. I’m using an objectvalue and setting it to my event. My scripts are just having a hard time getting hold on my module script

Do you have a script handling the events when they are fired?

1 Like

Could perhaps use the __namecall method on your remotes.

I’d probably be using a client-script to fire an event with the door the mouse clicked on.

client(mouse.Target) => server(onServerEvent(target))

1 Like

I do, but I’m remaking it right now

Well, I’ve gotten past a lot of that stuff, I’m just having an issue getting access to my module now


image

local EventObj = game.ServerScriptService:WaitForChild("Doors").ValueEvent

You are trying to gain access to something only the server can access, which will come back as an error as the client cannot see anything in server storage or server script service.

1 Like

yep yep! Thanks a lot man lol.

I just had to use Object values to get what I needed! Thank you everybody for your help! :slight_smile: