SetAttribute doesn't Update to Server

So, I’m attempting to read an attribute set by a localscript but the server doesn’t notice the change.

I was under the impression that Attributes were updated for both the client and the server, is this not the case? Currently in my game, I use another localscript to display stamina and update it on the player’s humanoid, and the server scripts can read that just fine using the AttributeChangedSignal.

If you’ve got an answer for me, please share it.

Attributes like everything else, doesn’t replicate to server unless you use remote events

1 Like

According to the documentation changes to attributes should replicate, perhaps you need to wait for the change to replicate before checking if the change has replicated.

Never mind, I just noticed you’re trying to change the attribute on the client.

1 Like

It means attributes on the server replicate to the client, not the other way

1 Like

As suggested, use a RemoteEvent instance (or RemoteFunction if data needs to be returned back to the client) and set the attribute’s value on the server.

I think I’ll just swap the script over to the server and put the few client-related things into a different localscript. Thanks for the help though.