door = script.Parent
local list = game.ServerStorage.Colors:GetChildren()
local list2 = game.Workspace.Colors4.pads:GetChildren()
local pm = game.ServerStorage.pm.Value
function onChatted(msg, recipient, speaker)
local num = 0
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == ":randomize") then
repeat
list2[math.random(#list2)].BrickColor = list[math.random(#list)].Value
num = num + 1
print(num)
wait()
until num == 9
end
num = 0
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
The script I have works fine but it has 1 problem. I do not want the color to be repeated onto any of the bricks. I tried using variables in a earlier version of this script but that did not work.
Thanks if you decide to help out, thanks if you just read this.
- UltChowsk

6 comments
I put it in and got a stack overflow.
Any idea how to prevent that?
It may be becausen you used up all of the brickcolors available.
I have 9 seperate colors. Thats what the local variable list is for, I am trying to get it to pick from those 9 to change 9 different bricks without any repeats.
Then it should work.
I got a stack overflow every time I tried.