How do you find the script which fired the remote event?

I’m making a dialogue system, I have a variable which changes depending on the dialogue that needs to be shown (it controls which dialogue is active). I have this trapdoor which the player cannot go through unless they have a certain item, if they try going through then a dialogue needs to show. Hinting that the player needs a certain item (I use proximity prompts).

However, how am I supposed to tell if the script that fired the remote event was the script in charge of checking if the player has the item or not? Is it possible?

1 Like

Try making a random Name generator, name it on the script.
Fire the remote event with the script name.
Check if the script has the same name as the fired script name.
(or you can put it unto a stringvalue)

1 Like

You can pass the script as an argument, but I don’t really see why you would need to do this? Surely there are better ways for you to check that a certain action should/shouldn’t happen.

Actually, you can’t pass object values through RemoteEvents/RemoteFunctions.

Yes you can? Not sure where you got this information from, you can’t fire local objects through remotes though because they dont exist on the server.

3 Likes

I’m back everyone, I just fixed it by creating several individual remote events instead.

1 Like

I see, maybe that might be the case. I know that I used to be able to do this, but I wasn’t too sure if it was possible now. Probably because me attempting to send client-sided objects never worked, which is probably why I thought it wouldn’t work.