So I am making a game that uses XP. I’m having trouble with a working XP system. It gives me 1 257500XP 100/257500 = level 1 and I don’t know why.

Here is my XP to level calculator

function levelCalculator(player)
if getSessionData(player) < 100 or getSessionData(player) == nil then
return 1;
else
local terms = tonumber(getSessionData(player));
return math.floor((-75 + math.sqrt(75^2 + 4 * 25 * terms)) / (2 * 25));
end
end

Here is my Level to XP calculator

function LevelToXPCalculator(player)
local levelFrame = player.PlayerGui.CoreUI.Menu.LevelFrame;
local currentXP = getSessionData(player);
return currentXP / 2 * (2 * 100 + (currentXP - 1) * 50);
-- Increment 50 each time
end

Could you guys help me identify the error or link me to better resources for XP?
Thank you.

local function getExpFromLevel(level)
return level * EXP_PER_LEVEL + START_EXP
end
local function getLevelFromExp(exp)
return (exp - START_EXP) / EXP_PER_LEVEL
end