Here, I expect Studio to suggest the argument names and types from the function I assigned in the Script. It can only retrieve the argument format for :InvokeServer().
No, you shouldn’t do this, even though you can. The reason is simple - just look at it from the engine’s perspective - you (or rather, anyone who modifies the client) can send anything from this client, and a cheater can send a number instead of the expected string, and so on. Therefore, attempting to do so is logically incorrect.
local a: RemoteFunction = "Here"
local b: (self: RemoteFunction, one: string, two: number) -> (boolean?) = a.InvokeServer
-- first `(...)` is args what u want to give, second `(...)` is args than return server
local c = b(a, "hi!", 2) -- c is boolean?
Although I would also type it in general, due to my love of strict typing (which doesn’t make much sense in a dynamically typed language in general except when you want your code to be “pretty” for someone else to use without looking inside), don’t forget to validate that the first argument is a string and so on.
and yes, you might be wondering why I’m passing the RemoteFunctioin itself as the first argument. This is because we need to pass the object on which the method was called, otherwise the luau interpreter won’t understand anything. In other words, object:method() is equivalent to object.method(object) or class.method(object)
To ensure the type correctness you can use an awesome tool created by osyrisrblx, called “t”.
It’s an awesome tool to ease the process of ensuring correct types, and it’s also recommened to use by Roblox.