I would like to make a coding script that picks a random StringValue located inside another StringValue called Options. This is the code I have, but it is only picking the first parent inside Options.
script.Parent.Changed:connect(function(val)
if val == true then
local list = script.Parent.Parent.Parent.Parent.Options:GetChildren()
local m = list[math.random(#list)]
local n = math.random(1,2)
if n == 2 then
-- Coding here that has nothing to do with other functions
elseif n == 1 then
-- Coding here that has nothing to do with other functions
end
val = false
end
end
end)

1 comment
mshould definitely be a random child ofOptions-- can you be more specific with why you think there's a problem? (The code you posted doesn't usemso I'm guessing somewhere else along the way you have a mistake)