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

How can I use an "IntValue" as a Global Variable?

Asked by 1 year ago

I'm not able to perform arithmetic on an IntValue I placed in ServerStorage. For instance:

local i = game.ServerStorage.i
    i = i + 1 --Error here

What can I use instead? I need to access this variable between two scripts and manipulate it as shown above.

0
the only solution i could come up with, is to just use replicated storage instead kingmaster1033r 0 — 1y
0
What do you mean? Like use a remote event to communicate between the two scripts or place the IntValue in replicated storage? sebastian1102 11 — 1y

1 answer

Log in to vote
1
Answered by 1 year ago

u forgot to put .Value, so do local i = game.ServerStorage.i i.Value = i.Value + 1

Ad

Answer this question