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

Help with Filtering Enabled?

Asked by 8 years ago

Hi guys,

I want to convert my place to FE but after switching it on and playing around with RemoteEvents theres a few things I'd like to ask:

First of all, my place stores Player stats (in the form of IntValues etc) inside the Player when they join. By player stats I mean - if they are playing the next round (i.e afk or not) - how many lives they have - if they are actually in the level (used to add up all the people who didn't finish when time is up)

With FE, my Server script that handles the event whereby a player changes whether they play the next round, does not do anything. Someone said on here a few days ago that server scripts cannot access the player with filtering enabled. Is this correct? If so how can I store these player values?

Should I store every player's values within a folder in ServerScriptService or workspace and use a RemoteEvent to make the server change them for each player?

This also brings me on to my other question. Say I implemented the solution I outlined above with one 'server event handler' changing all player values when the player requests that they be changed (the server can also change these directly whilst the game is running, which again it wouldn't be able to do with FE if I am correct - e.g deaths wouldn't be able to change the lives value because it was in the player).

If everyone decided to change if they were playing in the next round at the same time, would the script 'hang' whilst it processed all the requests or would multiple instances of the same script be processing each event that was fired from the client? This question ties in with FE but is also a more general question I have.

If you read all of this then I much appreciate it, and anticipate any answers you guys have.

Thanks, MD

1 answer

Log in to vote
3
Answered by 8 years ago

I have to say, I find some details in your question a little unclear, but I'll answer this the best I can.

How FilteringEnabled really works

"Someone said on here a few days ago that server scripts cannot access the player with filtering enabled. Is this correct?"

No, not at all. There's something really important you should note here: every time you play a game, that game is running in 2 different places: The client (the individuals computer), and the server (information that replicates to all clients).

This means every time something happens to a client, that client sends data to the server, which then replicates to all clients. Allowing everything to interact with each other.

So how does it effect communication?

Think of FilteringEnabled like a door that you can open and close. If a door is open, everybody on the opposite end of that door will be able to see all changes made inside the room. If the door is closed, people outside the door won't be able to see any changes, but the person inside the room can see everything that's going on. In this analogy, the room is the client, the space outside the room is the server, and obviously the door is FilteringEnabled.

Strong recommendations - Storage

Saving your data:

I strongly recommend not having to rely on your game's environment to handle important tasks data-managing wise (by this I'm referring to the IntValue).

All of your game logic should be handled and managed with code inside your script, not IntValues. If you need to share information between any kind of script, you should use remote objects (or global values if it's between the same kind of script).

Storing your objects

You shouldn't put anything except a server script (or folder objects) inside the ServerScriptService. If you need an organized place to store replicated information, use ReplicatedStorage.

Here's a layout of how I store things using an example from a project I'm working on: http://prntscr.com/9klzmc

Hope this helped.

0
Very detailed responses in all your answers +1 NinjoOnline 1146 — 8y
0
Thank you ^-^ How2Script 105 — 8y
0
Sorry that my question was a little unclear but you've answered my question pretty well :D. One more question though; I knew that using IntValues wasn't very good practice, but how would I store individual values for multiple players? You mention remote objects. What are those? Thanks again MasterDaniel 320 — 8y
0
No problem, glad you found it somewhat helpful. You can use dictionary-styled tables to store individual player data with their UserIds. What I meant by remote object was basically any kind of remote connection a network of scripts have with each other (i.e, RemoteEvents, RemoteFunctions, BindableEvents, BindableFunctions, ect). How2Script 105 — 8y
View all comments (2 more)
0
I could create an example and uncopylock the place if you'd like. How2Script 105 — 8y
0
Okay - I only started using RemoteEvents a few days ago haha and the place would be very helpful <3 MasterDaniel 320 — 8y
Ad

Answer this question