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

Nothing is wrong with the output I need help can someone fix?[UNANSWERED]

Nothing is in output, literally it shows nothing... I need help, what's wrong with this script please!!





--I edited as best I could, but I could not understand most of the coding/what you were trying to do, so I edited what I thought you were trying to do

 

repeat wait(0)until game:FindFirstChild("Teams")

local NumPlayers = 2 --Change this to the number of players needed

local A = game.Players

local A1 = "This service is unavailable, please wait until 1 more player joins..."

local A2 = "Welcome to the official meadows sfing game"

local A4 = "5"

local A3 = "The amount of players is successful, and the game will be starting in" .. A4 .. "Seconds.."

local A5 = "Teaming players..."

local A6 = "Blue team has won"

local A7 = "Red team has won"

local BlueTeam = game.Teams:WaitForChild("BlueTeam")

local RedTeam = game.Teams:WaitForChild("BlueTeam")

local redplayers = 0

local blueplayers = 0

local M = Instance.new("Message")

local TimeForLoop = .5 --This will loop the script every .5 seconds

local players = 0

local GameRun = false

 

function fixTeams()

BlueTeam:Clone().Parent = game.Teams -- Whats 'clones[1]'?

RedTeam:Clone().Parent = game.Teams -- Whats 'clones[2]'?

end

 

function checkSpectators()

spectators = 0

for _, player in pairs(game.Players:GetChildren()) do

if player.TeamColor == game.Teams.Spectators.TeamColor then

spectators = spectators + 1

if(spectators >= NumPlayers) then

BlueTeam:Destroy()

RedTeam:Destroy()

wait(3)

end

end

end

end

 

function findwinner()

for _, player in pairs(game.Players:GetPlayers()) do

if player.TeamColor == BlueTeam.TeamColor then

players = blueplayers + 1

wait(5)

if blueplayers == 0 then

print("Blue team has lost")

M.Text = A7

elseif player.TeamColor == RedTeam.TeamColor then

players = redplayers + 1

if redplayers == 0 then

print("Red team has lost")

M.Text = A6

end

end

end

end

end

 

function StartGame()

if GameRun then

fixteams()

checkspectators()

findwinner()

end

end

 

while wait(TimeForLoop)do

if A.NumPlayers >= NumPlayers then

GameRun = true

StartGame()

else

GameRun = false

print("There's not enough players in the game for the game to start.")

repeat wait(0)until A.NumPlayers >= NumPlayers

end

end




1 comment

0

Oops, that was embarressing, sorry chores

1 answer

You can't use numbers as variables

2 comments

0

How not?

0

Varaibles can't start with numbers. Like 4A, A1 is perfectly fine.

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