local Players = game:GetService("Players") local ServerStorage = game:GetService("ServerStorage") local minPlayers = 10 local maxPlayers = 10 local gameStarted = false local equations = { {question = "1+1", answer = 2, difficulty = "Easy"}, {question = "900/1", answer = 900, difficulty = "Impossible"}, {question = "9+9", answer = 18, difficulty = "Hard"}, {question = "3+1", answer = 4, difficulty = "Easy"}, {question = "(1000*2)+500", answer = 2500, difficulty = "Professional"}, } local function assignSeats() local players = Players:GetPlayers() if #players >= minPlayers then gameStarted = true for i, player in ipairs(players) do local seat = workspace.Seats:FindFirstChild("Seat" .. i) if seat then player.Character:SetPrimaryPartCFrame(seat.CFrame) end end end end local function showEquation(player, equation) local gui = ServerStorage.QuestionGui:Clone() gui.Question.Text = equation.question gui.Parent = player.PlayerGui end local function checkAnswer(player, input, equation) if tonumber(input) == equation.answer then player.leaderstats.Winstreak.Value = player.leaderstats.Winstreak.Value + 1 game:GetService("SoundService"):PlayLocalSound(workspace.WinSound) -- Play win sound else game:GetService("SoundService"):PlayLocalSound(workspace.KillSound) -- Play kill sound player:Kick("Wrong answer!") end end local function startGame() if gameStarted then return end assignSeats() local players = Players:GetPlayers() for _, player in ipairs(players) do local randomEquation = equations[math.random(1, #equations)] showEquation(player, randomEquation) end end Players.PlayerAdded:Connect(function(player) if #Players:GetPlayers() >= minPlayers then startGame() end end) -- Teacher Buttons for Correct/Wrong local function teacherButtons() local teacher = workspace.Teacher -- Assuming there's a teacher model local correctButton = Instance.new("TextButton") correctButton.Text = "✔ Correct" correctButton.Parent = teacher local wrongButton = Instance.new("TextButton") wrongButton.Text = "✖ Wrong" wrongButton.Parent = teacher end teacherButtons()