Instance Attributes and Security

Hello

I’m wondering about the security of instance attributes.

I’d like to store data in a table on the server and load pieces of it into instance attributes on the character. Gameplay may then modify these values. Finally, when I save the data, I would read it from those instance attributes, back into a table for storage.

My question is, while the data is sitting in the attributes during gameplay, is it secure? I’m not worried about the player viewing the data, but I wouldn’t want them to be able to modify it.

Thanks in advance!

The player to my knowledge should not be able to edit these values as they are stored on the server. The only values the player can “change” are things that are required to be replicated, i.e. speed. Obviously on the client that value will change, however it won’t affect the server a.k.a the player can’t give themselves infinite money.

1 Like

Client changes to attributes wouldn’t replicate, like anything else. So just read the attribute values from the server and you will be fine

5 Likes

Thanks. Just so I’m clear, by “read from the server”, if I’m doing something along the lines of :

player.Character:GetAttribute("key")

From a server script, that’s going to be fine?

Yep, The server and the client keep separate caches of attributes. When you update a server attribute the client’s attribute cache is also overridden.

When the client updates their attributes it does not replicate to the server.

2 Likes