Number values...are they safe and efficient?

I’m working on a combat system at the moment and it pretty much used number values for everything in terms of damage, crit chance, weapon level etc.

I personally love using number values and use them every chance I get, BUT…are they safe from exploiters? Can a hacker access these values and manipulate them? The values are stored within a folder inside the tool.

Using number values just makes everything easier and more manageable imo. It just makes things easier when it’s time to increase weapon damage or level values.

Anyone know if this is a good idea?

Can’t you just store them in scripts and then send it to the server? Wouldn’t be more efficient?

1 Like

i could be completely wrong, but i think exploiters can get instances with no parents;
so you should only work with ‘orphan ValueBases’ on the server

1 Like

Well, exploiters can’t touch the server so NumberValues on the Server cannot be touched by exploiters.

1 Like

i guess i misunderstood what you meant by sending it to the server (why send it to the server if it’s already on the server)
it looks like we’re saying the same thing

1 Like

Yeah, I assumed the combat system mainly runs on the client so with Remote Events or a Network System (which is better to use) you can send information instead of having lots of Number Values in the game.

1 Like

I believe it should be safe. The only issue would be if the server is reading the values from the client via a remote event, then the client could manipulate them. But if the server is reading directly from the value, then it will only see changes made by the server, not by any client.

2 Likes

Number values and any roblox instance is slower than storing the values directly in a lua table, in a module script, or somewhere else. However, with number values, you would need to access it VERY OFTEN for the performance to be an issue, so it’s totally fine to use them

As for exploiters, they can modify it On the client only, like almost everything else. The value on the server wont change. Make sure to have sanity checks on the server to prevent the client from sending some fishy data to gain an advantage

2 Likes

dictionaries, attributes, and variables are significantly faster than instances and properties

1 Like

Wouldn’t using a dictionary require me to add every tool in my game into the dictionary?

You could use a module for that, easy and quick.