Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is Invoke and onInvoke?

Asked by 9 years ago

I really NEVER understood this. I actually came across this in PeasFactory's tutorials. So I really never gave it any thought I just shoved it to the back of my head. But I want to actually bring that thought back and exterminate my questions about this. How is this useful? And what does it do? Hope I get a good answer.

1 answer

Log in to vote
1
Answered by
ipiano 120
9 years ago

I would advise reading through this page: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial

I believe it's what you're looking for. But basically, with the new Filtering ability of Workspace, to prevent hacking, you can't communicate between the client and server properly without using RemoteEvents or RemoteFunctions.

When you call a RemoteEvent you call Event.FireClientEvent() Likewise, you can call a RemoteEvent on the server from a client with Event.FireServerEvent()

However, you can't get a return value from those events, they are just a one time fire and done. If you have to get a return value, then you need to use a RemoteFunction, and to call those you use InvokeClient/Server() and OnServer/ClientInvoke()

Hope that helps!

Ad

Answer this question