Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help on IntValues?

Asked by
Mystdar 352 Moderation Voter
10 years ago

Can an IntValue be a word or just a number. So could you set an IntValue to a word, for example if you had an element IntValue could you make one of them Fire, or not? (Setting Intvalues)

1 answer

Log in to vote
2
Answered by 10 years ago

An IntValue can only take integers, which are rational numbers that are whole (no fractional component.)

Setting the value of a IntValue to something other than an integer would usually default the value to 0. However, you can also have a string that is an integer which can be set as the value of the IntValue. For example, using the below code in the command bar (assuming you have an IntValue in Workspace called "Number"):

game.Workspace.Number.Value = "123"

Would set the value of the IntValue to 123, converted into a integer from a string by the script.

Ad

Answer this question