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

How do I/Is it possible to change multiple values at once?

Asked by 2 years ago

Picture this, I have 10 different IntValues in the game, which have the same value, which are in different parts of the game for example one is in a folder in workspace but another one is in a model in replicatedstorage, but I want to change all of them to a different value, is it possible to do that and if so how do I? Or do I have to painstakingly change every single one of the manually?

1 answer

Log in to vote
0
Answered by 2 years ago

You can make a function that'll change all of them to a value that you want.

You could use a for loop too if they had the same parent.

EX: Function

local Value = --whatever you would want here

local function ChangeV()
    game:GetService("Replicated Storage").Value = Value
    workspace.Folder.Value = Value
end


ChangeV()

EX 2: For Loop (If had same parent)

local Value = --whatever you would want here

for i, Value in ipairs(workspace.Folder:GetChildren()) do
    Value = Value
end
Ad

Answer this question