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

How to give client immediate feedback with FE?

Asked by 6 years ago

So with FE, the standard procedure I've seen a lot of models do is to simply let the server handle everything and wait for replication back onto the client.

So suppose you've got a sword tool compliant with FE. The first free model I grabbed followed the procedure of

  1. Tell the server you want to use the sword

  2. The sword slashes on the server

  3. The action is copied onto the client.

This of course has one big downside, as the client does not get immediate feedback to the action he performed. That is, if he clicked, he would not see the slash right away, but after the server copied the action back onto the client. Note that this is not an instantaneous process.

The way this would be solved is to have the client play the animations of moving the sword while the server performs the damage. Since the client has control of the handle and the character, all actions performed with motion will automatically copy onto the server.

What I'm asking, is how could I apply this to the creation of new Parts? For example, when you create a part on the client, it's a local part. i.e: the server doesn't see it at all.

You of course could have the server create it and wait for replication, but you still have to wait for the replication to be performed, as stated earlier.

You could create a copy on both the client and the server, but the server copy will go back to the client and suddenly the client will have 2 copies.

Any reccomendations would be helpful

0
Create the copy on the client, fire the event on the server, detect when the server version of the part is added from the client and then delete it from the client. mattscy 3725 — 6y
0
But won't there still be an instant on the client where there are 2 of the same object? randomsmileyface 375 — 6y

2 answers

Log in to vote
2
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

If you want an easy way, you can do as I’ve recommended in the comments. However there is another way to do this so that the client doesn’t have to delete the part.

First, create a folder in workspace (called PlrFolders for the sake of the example)

Then, automatically add a folder inside PlrFolders for every player who joins, and remove that folder when they leave. Name these new folders by the player’s user ids.

In each player’s local script, detect when a folder is added that is named after their user id, and delete this folder from the client (so that on their client, they can only see everyone else’s folders)

Then when you add the part from the server, you can add it to the folder that has the user id of the player who created it. Because this folder would be deleted on that player’s client, it will only show for all the other players, thus not resulting in two parts.

0
Interesting approach! Hadn't thought of doing this. WillieTehWierdo200 966 — 6y
1
100% credit to amanda for the idea mattscy 3725 — 6y
0
Sounds like a great approach randomsmileyface 375 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

If the part has to be visible to all players but the exact positioning is not important (eg. a bullet casing flying out of a gun in a random direction), you can first create the part locally on the LocalPlayer, then fire an event to the server to relay the message to all the other clients to also render the part with minimal info carried over (such as CFrame). That way, the part only exists on the client machines and is never instantiated on the server.

If the part must interact with more than one player or the world in general, you have to create the part on the server. No option. However, once the part is created, you can set the NetworkOwner of the part to a player, if it makes sense for that player to have immediate feedback. An example of this would be a two-seater car with the LocalPlayer as the driver, but another player as a passenger.

Answer this question