This is really for my friend, but I'm asking it. He needs this quiz to give you a rank on his group. There are no errors in the two scripts.

This is the ranking script. it is a sss regular script

local WrongAnswersToFail = 1
local PassRank = 2
local GlitchURL = "https://robloxcatbot.glitch.me/" --Place the glitch project URL inside of the quotes

function rankUser(UserId, RoleId)
    game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end

local FinishText = Instance.new("StringValue", game.Lighting)
FinishText.Name = "FinishText"

function passUser(Player)
    print("User passed")
    game.Lighting.FinishText.Value = "Great work! You've passed your application! You've just been ranked in the group."
    rankUser(Player.UserId, PassRank)
end

function failUser(Player)
    print("User failed")
    game.Lighting.FinishText.Value = "You've failed your application. Try again later!"
    wait(1)
    Player:Kick("You've failed your application. Try again later!")
end

game.ReplicatedStorage.FinishApplicationEvent.OnServerEvent:Connect(function(Player, Questions, UserAnswers)
    local IncorrectAnswers = 0

    for i = 1, #Questions do
        local CorrectAnswer = Questions[i][6]
        if CorrectAnswer ~= UserAnswers[i] then
            IncorrectAnswers = IncorrectAnswers + 1
        end
    end

    if IncorrectAnswers >= WrongAnswersToFail then
        failUser(Player)
    else
        passUser(Player)
    end
end)

This is the glitch script. Its in JavaScript. I have no idea what it does lol

var groupId = 7755297 // << Replace 12345 with your Group Id
var cookie = "_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_E1340866C608C922D12E00617DC5BC3DC8088C1F23CA54BB08DAA3FF144F17A9EB95234EC525AF7B1E30D0C8C8BFD504C0BABE271281BE68A95BCE50C6265C6BEE5C4006F7EE420E7E42198E0E5243C965C4EE8CDB4665566C4DB56B01E61E3C602AD0BF021BA9D9A040095BBE05BB8130CE74972E03882E94203EB2B5AC022B8222D482EAF46692071A3F36E001A1525E937BA2BA12D347717834AFEDB560A896F2D119ABDF64A8603B10A7D94A262A1D524C90E4A994C5E3C210EAEDFD035B63B158340030472A467EB826B7757E08BB63AFD078F2C2364470F7E434EEE3D6BCD7DCAB2029614BEA31A4487716DDF7D58C16F11A716A9A76FE1706936B2B3FDFCFC4F7BA9778C316F0B201170350B7294DB677B894E78E1D1EEDB58D76F24B9BDBB8B2" // << Put your account cookie inside of the quotes
 
/INSERT GROUP ID AND COOKIE ABOVE/
 
 
const express = require("express");
const rbx = require("noblox.js");
const app = express();
 
app.use(express.static("public"));
 
async function startApp() {
  await rbx.cookieLogin(cookie);
  let currentUser = await rbx.getCurrentUser();
  console.log(currentUser.UserName);
}
startApp();
 
app.get("/ranker", (req, res) => {
    var User = req.param("userid");
    var Rank = req.param("rank");

    rbx.setRank(groupId, parseInt(User), parseInt(Rank));
    res.json("Ranked!");
});
 
const listener = app.listen(process.env.PORT, () => {
  console.log("Your app is listening on port " + listener.address().port);
})

question answerer - works dont really need to read this is in a gui and is a local script

local Questions = {
	[1] = {
		"Do you have to use grammar at our game?",
		"Yes",
		"No",
		"IDK",
		"Meow I like cat nip",
		2
	},
	[2] = {
		"what is your favorite animal",
		"Rat",
		"Cat",
		"Dog",
		"Meoooow I want cat nip",
		2
	},
	[3] = {
		"Will you abuse your powers given to you buy the wonderfull Meowingtons?",
		"Yes",
		"No",
		"Cat nip PLS",
		"Meow meow *plays with string*meow",
		2
	},
	[4] = {
		"Click on a ally or a enemy of our group",
		"Cat nip united",
		"Humans united",
		"Tiger group",
		"*epicly gets out yarn and plays then falls asleep*",
		3
	},
	
}


local Player = game.Players.LocalPlayer
local MainFrame = script.Parent.MainFrame
local TopText = MainFrame.TopText
local BeginButton = MainFrame.BeginButton
local AnswersFrame = MainFrame.AnswersFrame
local AnswersFrameSize = AnswersFrame.Size

local Answer1 = AnswersFrame.Answer1
local Answer2 = AnswersFrame.Answer2
local Answer3 = AnswersFrame.Answer3
local Answer4 = AnswersFrame.Answer4

local ZeroSize = UDim2.new(0, 0, 0, 0)

local currentQuestion = 0
local UserAnswers = {}

local function finishApplication()
	print("Application finished!")
	game.ReplicatedStorage.FinishApplicationEvent:FireServer(Questions, UserAnswers)
	wait(1)
	TopText.Text = game.Lighting.FinishText.Value
	AnswersFrame:TweenSize(ZeroSize, nil, nil, 0.3)
end

local function nextQuestion()
	currentQuestion = currentQuestion + 1
	
	if currentQuestion == #Questions + 1 then
		finishApplication()
		return
	end

	local currentQuestionArray = Questions[currentQuestion]
	
	local Question = currentQuestionArray[1]
	local QAnswer1 = currentQuestionArray[2]
	local QAnswer2 = currentQuestionArray[3]
	local QAnswer3 = currentQuestionArray[4]
	local QAnswer4 = currentQuestionArray[5]
	local CorrectAnswer = currentQuestionArray[currentQuestionArray[6] + 1]
	
	TopText.Text = Question
	Answer1.AnswerText.Text = QAnswer1
	Answer2.AnswerText.Text = QAnswer2
	Answer3.AnswerText.Text = QAnswer3
	Answer4.AnswerText.Text = QAnswer4
--	
--	for i = 1, #UserAnswers do
--		print(UserAnswers[i])
--	end
end

local function setupQuestions()
	nextQuestion()
	for i = 1, #AnswersFrame:GetChildren() do
		local Child = AnswersFrame:GetChildren()[i]
		if Child:IsA("Frame") then
			Child.SelectButton.MouseButton1Click:Connect(function()
				table.insert(UserAnswers, Child.AnswerNumber.Value)
				nextQuestion()
			end)
			Child.SelectButton.MouseEnter:Connect(function()
				Child.SelectButton:TweenSize(UDim2.new(0.1683, 0, 0.6435, 0), nil, nil, 0.1)
			end)
			Child.SelectButton.MouseLeave:Connect(function()
				Child.SelectButton:TweenSize(UDim2.new(0.153, 0, 0.585, 0), nil, nil, 0.1)
			end)
		end
	end
end

local function beginQuiz()
	BeginButton:TweenSize(ZeroSize, nil, nil, 0.3)
	wait(0.3)
	BeginButton.Visible = false
	
	AnswersFrame.Size = ZeroSize
	AnswersFrame.Visible = true
	AnswersFrame:TweenSize(AnswersFrameSize, nil, nil, 0.3)
	
	setupQuestions()
end

BeginButton.MouseButton1Click:Connect(function()
	beginQuiz()
end)

5 comments

0

Make sure the bot is ranking the player a rank below him and also make sure the bot is a valid rank in the group to rank others.

0

my friend says it not work

0

What isn't working? You just said it isn't working and threw code at us without any explanation.

0

Also, I believe there was a function :SetGroupRank() or something like that, but I'm not sure.

0

What isn't working with this code? You have not made your question descriptive. Have you tried using print or any source of debugging?