So, I made a script that gets a random member from an array. Its parent is a StringValue in workspace. I don't get any errors in the output. Can anyone help? Thanks for helping.
moves = {"move1"; "move2"; "move3"; "move4"; "move5"; "move6"} function r(m) return math.random(m) end s = r(#moves) selected = moves[s] print(selected) script.Parent.Value = selected
Once again, thanks for helping. It is really appreciated.
I am not a professional at scripting just starting on new stuff but 100% these might not work so try
moves = {"move1"; "move2"; "move3"; "move4"; "move5"; "move6"} function r(m) return math.random(m) end s = r(#moves) selected = moves[s] print(selected) script.Parent.random.Value = selected
And if this doesnt work try using this
moves = {"move1"; "move2"; "move3"; "move4"; "move5"; "move6"} function r(m) return math.random(m) end s = r(#moves) selected = moves[s] print(selected) script.Parent.moves.Value = selected
when you are using math.random() you need to give min number and max number
It turns out the problem was it was accidentally a LocalScript. I'm very sorry to everybody who took their time to test the script and answer the question. To apologise, I will upvote all the answers and comments.