How to know which script fired to server, etc.?

If your doing this for security reasons this would be your best bet. When the event is Fired have a arg. That requires a player then have your server script check if that player is legit and allowed to run it. Then send the information directly to that player instead of returning it though the same request.
(Sorry if this is old I don’t see it solved so)

you could make a function in the modulescript and call that function to update the variable

wouldnt calling the module’s function from a localscript still not affect the server? would the server script see changes (haven’t developed on roblx in a while, so sory) .

honestly this is so long ago, i am not exactly sure what I was even trying to acheive.

yeah you’re right, please ignore my comment. lol

I know how to fix you problem but in a different way then checking wich script fired the RemoteEvent.

You need to make a RemoteFunction in the workspace or any location that the server can reach.
Lets call it getPasscode.

Make BindableFunction and call it passcode.

Make a script and put this code in it:

local HttpService = game:GetService("HttpService")

local passcodes = {}

local legalValidationTypes = {
	test_validationType = true
}

function getCode ()
	return HttpService:GenerateGUID(false)
end

function script.Parent.getPasscode.OnServerInvoke (player, validationType)
	if legalValidationTypes[validationType] == nil then return "That is not a valid validation type" end --- validation type does not exist
	if passcodes[player] == nil then passcodes[player] = {} end --- make it a table if it isnt yet.
	if passcodes[player][validationType] ~= nil then return "Do not hack pls" end --- if this is the case then the pascode has ben given already
	
	passcodes[player][validationType] = getCode()
	
	return passcodes[player][validationType]
end

function script.Parent.passcode.OnInvoke (player, validationType) --- give other server scripts access to the validation code
	return passcodes[player][validationType]
end

now when you have a local script that needs to be allowed to :Fire() an event. What you do is.
In the local script you request a validation code.

local validationCode = workspace.getPasscode:InvokeServer()

This will give you a code wich the server saves for you.
If this event is fired again. The server wont give you a new one.

Whenever the player wants to fire a remote event. You can check inside the remote.OnServerEvent

if validationCode == workspace.passcode:Invoke(player) then
 --- It will only get here if the code the user gave is the same as the code the server stored.
 --- since the code is only granted one time per script.
 --- No cheater can ever get the code.
end

If you want to vlidate another script add a value to the legalValidationTypes and when your scipt wants a validation code it needs to be the same as you just added to legalValidationTypes.

only works if the scripts request their code on enter. Or the user can request the code before the valid script does. And since injectors dont emedietly run. they wont get a code.