I want to make a random map selector, but it seems that the selector is picking a map and not continuing, I want it to pick a map and then keep repeating
local function changed() if game.Workspace.time.Value == 0 then local e = math.random(1,2) if e == 1 then choice = map2 end if e == 2 then choice = map1 end game.Workspace.time.Value = 30 choice:Remove() wait(3) choice.Parent = game.Workspace end end
sorry for gross code I was tired when I made this lol, (and im decently new to scripting) the event is fired every second
Hello!
I didn't understood much, but I think I found the problem.
local function changed() if game.Workspace.time.Value <= 0 then local e = math.random(1,2) if e == 1 then choice = map2 end if e == 2 then choice = map1 end game.Workspace.time.Value = 30 -- choice:Remove() task.wait(3) -- use task.wait instead of wait. choice.Parent = game.Workspace end end
You :Remove
the choice, then parenting it to workspace, for whatever reason. Theorethically, it should fix the problem, altrough you might need a cleanup function. Also I changed if game.Workspace.time.Value == 0 then
.