Hey guys, so I am making a map voting thing. Similar to the voting gui in the car crushers 2 derby mode, I have got this code:
--events
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local info2 = ReplicatedStorage:WaitForChild("info2")
local info1 = ReplicatedStorage:WaitForChild("info1")
--stuff
while wait(1) do
local items = script.Parent.maps:GetChildren()
local randomItem = items[math.random(1, #items)]
local randomItem2 = items[math.random(1, #items)]
--code
if randomItem == randomItem2 then
repeat
local randomItem2 = items[math.random(1, #items)]
wait()
until randomItem ~= randomItem2
end
print(randomItem.Name, randomItem2.Name)
end
As you can tell it prints the chosen items every second. I think I can get the system that sends the information to the clients, but if not you will see me here again. The output will sometimes print the same names, for example:
map1 map1
I do have a picture of the output and I can attach it if you want but I don’t think that that is important.
The script works, just not how I intend for it to work