I'm making a button when clicked it deincerements a number by 1. I attempted to make the following:
game.ReplicatedStorage.PokeBall.Value = -1
But it changed the physical value to "-1".
Much appreciated if you can answer! YourFriendlyNeighbor
I'm making a button when clicked it deincerements a number by 1. I attempted to make the following:
game.ReplicatedStorage.PokeBall.Value = -1
But it changed the physical value to "-1".
Much appreciated if you can answer! YourFriendlyNeighbor
To decrement a variable, you should do something like this:
Variable = Variable - Value
In your specific case, this would be:
game.ReplicatedStorage.PokeBall.Value = game.ReplicatedStorage.PokeBall.Value - 1
This works by setting the variable (in your case game.ReplicatedStorage.PokeBall.Value) to the value it already has, minus the number to decrement by (in this case -1).
This discussion is preserved as it was. New answers, comments, and votes are closed.