Application center not working

So I am making an application center with a website called Replit in a node.js there are no errors and everything works except it doesn’t rank the player and here are the scripts.
Replit script:

var groupId = My group ID
var cookie = "My cookie (I put the right one)" // << Put your account cookie inside of the quotes

const express = require("express");
const rbx = require("noblox.js");
const app = express();

app.use(express.static("public"));

async function startApp() {
  await rbx.setCookie(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);
});

I also installed express and noblox package too.
Server script in roblox studio:

local WrongAnswersToFail = 1
local PassRank = 100
local Replit = "The replit link" --Place the glitch project URL inside of the quotes

function rankUser(UserId, RoleId)
    game:GetService("HttpService"):GetAsync(Replit .. "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)

There is a remote function in ReplicatedStorage called FinishApplicationEvent.
ClientScript:

local Questions = {
    [1] = {
        "Question1",
        "Answer 1",
        "Answer 2",
        "answer 3",
        "Answer 4",
        1
    },
    [2] = {
        "Question2",
        "Answer 1",
        "Answer 2",
        "answer 3",
        "Answer 4",
        1
    }
}


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)

And there are no errors and everything works but it doesn’t rank the player.

1 Like

You have a bot in the group right?

1 Like

Yep and it has permission to manage lower ranks.

Alright, well idk if I can help much I know a decent amount of JavaScript and JSON, could you show me your JS Code?
Edit: Mb thought the first one was lua for a sec Lel

Because I have no way of knowing if it’s that or your Lua script.

What programming software or thing are you using for JS?
Edit: Could be the software may not allow certain requests.

Oh wait I have an error that’s saying that the cookie is invalid so ima try to fix that first.

1 Like

Alr! Lets pray that’s your issue and not the software.

1 Like

Also, if you reload the page the cookie will be removed.

Use an Incognito tab (or your browser’s equivalent) to get it; that way closing/refreshing/etc the tab won’t cause the cookie to invalidate.

1 Like

It worked phew! Thanks for trying to help tho.

1 Like

Np glad you fixed it, prob should mark something as a solution so people know it’s fixed!