roblox studio script that makes A math game
Key RequiredUniversal

roblox studio script that makes A math game

Universal ScriptPOOIPOOPPOOIPOOP 5.1K views 35 executesUpdated Mar 27, 2025
Unrated
00
Lua Script•72 lines (2319 chars)
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()

Features & Information

-put this in server script service -server script BY CHATGPT

Community Comments (5)

POOIPOOPPOOIPOOPMar 27, 2025(edited)

good?

skyislandsskyislandsMar 27, 2025(edited)

this website is NOT for Roblox Studio, its for hacks...

isnoneisnoneMar 27, 2025(edited)

lol

POOIPOOPPOOIPOOPMar 29, 2025

lol this is a script

POOIPOOPPOOIPOOPMar 30, 2025

maybe it’s actually it works

More Scripts for Universal Scripts