Will value get overwrite by other client

Lets say that we have a remote function, a client Invoke the function and send a value (for example: 10) over to the server. Then on the server script it will receive it and overwrite it to a value then return that value.
Example:

local value
value = recievedValue
wait(5)
return value

What if somehow another client send in another value in that time, will the value returned to the first client be the new value that the client after it send?

Most likely not, however, that depends on where the variables are stored.

-- Alternative 1 (Won't overwrite)
function yourFunc(plr, receivedValue)
	local value -- Could also be written as ``local value = receivedValue``
	value = receivedValue
	task.wait(5) -- task.wait() is a more accurate wait()
	return value
end

-- Alternative 2 (will overwrite)
local value
function yourFunc(plr, receivedValue)
	value = receivedValue
	task.wait(5) -- task.wait() is a more accurate wait()
	return value
end

In Alternative 1 a “new” value is created for each invoke, which means they won’t “collide”. This means each invoke is completely isolated from one another and they are working on their own, separate, variables. This means it will not be overwritten.

In Alternative 2 value is declared outside the function, this means all functions are referencing the same value. Since they are all working on a shared value, that means it will be overwritten.