Due to Filtering Enabled I want to use remote events/functions, but the wiki does a poor job explaining things ever since they updated it. Could anyone give me examples of scenarios between client/server communication when it would be needed?
I can't really think of a logical scenario for this.
--in the LocalScript local RemoteFunction = --insert RemoteFunction hierarchy here print(RemoteFunction:InvokeServer("bar") --end of LocalScript --in a normal server script local RemoteFunction = --insert RemoteFunction hierarchy here function RemoteFunction.OnServerInvoke(variable) print("foo"..variable) return "foobar :D" end --end of server script
Output:
LocalScript foobar :D
Script foobar
Basically, the LocalScript gives the Script a part of the word "foobar," and the Script prints its part of the word along with the LocalScript's part of the word, to form the whole word. The LocalScript then prints the result that the Script gave it.
EDIT: Return does exactly what it sounds like. It returns objects from a function.
function returnText() return "hello!" end print(returnText) --prints "hello!"
RemoteEvents do the same thing as RemoteFunctions, just RemoteEvents don't return anything, minimizing latency. So basically, RemoteEvents just allow communications between LocalScripts and server Scripts, and vice versa.