Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Roblox U game loop, help?

Asked by
Master_JJ 229 Moderation Voter
9 years ago
001local checkpoint1 = game.Workspace.Checkpoint1
002local checkpoint2 = game.Workspace.Checkpoint2
003local checkpoint3 = game.Workspace.Checkpoint3
004local show = false
005local oldcars = game.ServerStorage:GetChildren()
006 
007local raceInProgress = false
008 
009function showVictoryMessage(playerName)
010    if show == false then
011        show = true
012        local message = Instance.new("Message")
013        message.Text = playerName .. " wins!"
014        message.Parent = game.Workspace
015        wait(2)
View all 186 lines...

I watched the video and I copied the code character to character but it before the race is over, it will start the game loop from the beginning. It would make new cars and delete cars while the race is still in progress.

1 answer

Log in to vote
0
Answered by 9 years ago

Try commenting out line 179 as shown below.

1--raceInProgress = false -- THIS IS LINE 179 - COMMENT THIS OUT
2 --wait for race to finish
3 while raceInProgress == true do
4     wait()
5 end

It looks like you might have added this - this value shouldn't be changed to false unless the 3rd checkpoint1hit event function is run, but of course it should be initialized at the top, which it is.

Ad

Answer this question