Custom statehandler ideas?

For my playerstates, before i had well over 10 boolvalues on the players humanoidRootPart, which sounds really unperformant, If i say had 10 players, THATS 100 BOOLVALUES! So I’ve decided to use a module script, I need ideas on how to go about this though, the requirements are the clients actions not replicating to server, the servers actions on it such as setting running to false replicating or other things, i just need something more performing, if my current Idea is already good as is please tell me!

1 Like

Why not just use a single string value in each player, and set the value to the relevant state.
e.g.

State.Value = "falling"
State.Value = "jumping"
State.Value = "climbing"

(Unless you intend to allow multiple states to be active at once. Then this wouldn’t work)

1 Like

Option 1 would be to use attributes instead of values. Then you don’t have a ton of instances clogging up the DataModel. Option 2 is to handle it all through script logic.

To be honest it probably doesn’t matter too much considering booleans are only 2 bytes or less over the network. Attributes may be the better option though due to not requiring more instances.

Where there be anyway to handle this in scripting? Ive been trying to come up with ways where the client can check their data on the module and so can the server but if its a client module they can just change what comes out right?

Well are the states only needed by one client or all of them?

I want the client to be able to check their characters state as well, but i dont want them to be able to change them and it replicated to server

Do you want all clients to see the states or just one though?

I’d strongly prefer the client only seeing theirs but it would be fine if they could see others, if your asking me if one client can see it, i would like all client to access their info

I think i’ve thought of a way, as long as module scripts when changed dont replicate to server ill have it in repstorage and deal with it there