I have a script for a EXP bar here, that has problems, the "alg" defines the leaderstats.EXP.value / 100 *leaderstats.EXP.value as seen in the script but when start the game it doesnt work, if i remove the * leaderstats,EXP.value then it works perfectly any ideas
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
leaderstats = game.Players.LocalPlayer.leaderstats
function ChangeSize(Front, Algorithm)
Front:TweenSize(UDim2.new(alg, 0, 1, 0), "Out",Enum.EasingStyle.Quint, 1, true)
end
while true do
local alg = (leaderstats.EXP.Value/ (100 * leaderstats.Level.Value))
ChangeSize(script.Parent.Back.Front, alg)
wait(0.5)
end
If i where to replace the
local alg = (leaderstats.EXP.Value/ (100 * leaderstats.Level.Value))
With
local alg = (leaderstats.EXP.Value/ (100))
The EXP bar works perfectly, but my aim is to increase the amount needed per level, I already have a script that is programmed to level up at the max exp per level but I want the same thing to be used as a max.
TL;DR I Want to find a way to make sure that the EXP bar doesnt just reach its limit after 100, because by level 2 the max exp would be 200 etc, but the EXP bar would stop halfway, How would i fix this?
NOTE: I Do not want the EXP bar to increase in size
