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

How to store many values in a StringValue ?

Asked by 5 years ago

I've tried stocking many values that i could read one by one into a StringValue. It didnt work so i don't know how to do it. Here's what i've tried :

-- The script that creates the value
local value = Instance.new("StringValue", game.Workspace)
value.Name = "TestValue"
value.Value = {"value1", "value2", "value3"}

-- A different script that is supposed to read the values
local value = game.Workspace.TestValue
for i=1,3 do
    print(value.Value[i])
end

1 answer

Log in to vote
1
Answered by
Miniller 562 Moderation Voter
5 years ago
Edited 5 years ago

There is no way to do that, use more stringvalues. One stringvalue, one value.. Or if you still want to do that with one stringvalue, read about string.gsub

Ad

Answer this question