Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this Game Script not Working?

So this script is supposed to reset and restart a game.

It doesn't do any of that, and I don't know why.

Here's the script:

local Timer = game.Workspace.Count
local Play = game.Workspace.Playing
local Score1 = game.Workspace.TOScore
local Score2 = game.Workspace.TTScore
local msg = Instance.new("Message")

while true do
	if Score1.Value == 2 or Score2.Value == 2 or Timer.Value == 0 then
		Play.Value = false
		Score1.Value = 0
		Score2.Value = 0
		Timer.Value = 20
	end
	if Score1.Value > Score2.Value then
	msg.Parent = game.Workspace
	msg.Text = "Blue has won the battle!"
	wait(4)
	msg:remove()
	elseif Score1 < Score2 then
	msg.Parent = game.Workspace
	msg.Text = "Red has won the battle!"
	wait(4)
	msg:remove()
	else if Score1 == Score2 then
	msg.Parent = game.Workspace
	msg.Text = "It was a tie!"
	wait(4)
	msg:remove()
	end
	Play.Value = true
	end
end

1 answer

I believe the error is on this line:

else if Score1 == Score2 then

You should change it to this:

elseif Score1 == Score2 then

1 comment

0

Thanks. I would try it out, but I recently found an alternative that has everything I need in it already. Thank you very much, I will probably use this for other things in the future.

This discussion is preserved as it was. New answers, comments, and votes are closed.