Client - Server - Client: ¿how can i do a task list?

Objective: i want the program to first call the local script and during the execution of the local script i dont want the script to continue, i want the normal script wait until the local script have finished.

The problem is that when i run my script the script continue the side script and the local script at the same time and i want a lineal execution.

i have a code but it became so complex, so i rather if you can please help me with your knowledge.

if you need another detail that can help you to understand, im happy to share with you! :grinning:

This is vague, but assuming you want a server script to wait for a client script to finish something, you can have the client script fire a remote event, and have the server yield until the remote event is fired

In the client script:

game:GetService("ReplicatedStorage").ExampleRemoteEvent:FireServer()

In the server script:

game:GetService("ReplicatedStorage").ExampleRemoteEvent.OnServerEvent:Wait()

Using :Wait() instead of :Connect() will make the server stop at that line and yield until the remote event is fired.

2 Likes

joe, you saved my life. We are friends. :smile:

1 Like

RemoteFunctions allow for this, RemoteEvents are only a one way connection (Server - Client and vice versa), while RemoteFunctions are two way connection (Server - Client - Server, and vice versa), you are able to return things with RemoteFunctions when fired, for the Server or Client to access.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.