Hello guys, so currently, I’m working to test out FireServer() to work with animating tools and stuffs.
But then I encounter an issue : The Sever Script runs after Local Script
So the problem is shown in the image below, you can see I used FireServer to tell the Server Script to work.
– Local Script –
But unfortunately, the script doesn’t work. At first, I though it was just because of I did it wrong somewhere, until I decided to print Children in both Local Script and Sever Script. Surprisingly, the Server Script runs after the Local Script although it’s told to be run first
Do you mean that when you call FireServer on the client, the client prints before the server does? FireServer is not blocking, so the LocalScript isn’t waiting for the server to get the message. The client sends FireServer and then prints. The server needs to wait for the FireServer event to be sent over the network, and then it has several additional lines of code before it gets around to printing.
If you need to wait for the server to finish, you should switch your RemoteEvent to a RemoteFunction.