im making a tutorial and want to go to the next information only when the previous info was used, in this case til the user clicks a cube, but every time it gets to that point and i click the cube, studio stops responding for a little bit and it says "game script timeout" and just doesnt work. it was fine and worked well til i added the "repeat" part
local text = "To start, Left Click the cube."
game.Workspace.Map.TutorialRestriction.Invis1.CanCollide = false
script.Parent.Tutorial.Click.Playing = true
for i = 1, #text do
script.Parent.Tutorial.Gui.TextLabel.Text = string.sub(text, 1, i)
wait(0.0625)
end
if text == "To start, Left Click the cube." then
script.Parent.Tutorial.Click.Playing = false
repeat
if game.Workspace.Interactables.Cube.Anchored == false then
script.Parent.Tutorial6.Disabled = true
end
until script.Parent.Tutorial6.Disabled == false
end

2 comments
didnt fix it either
wait, it did fix the game script timeout, but it didnt start the script it enabled