You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
i want the leading bar to begin in the begining and end at the ending -
What is the issue? Include screenshots / videos if possible!
either its toomuch to the right or too much to the left -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
lerping first digit subtacting previous goal
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- local script
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:wait()
end
RF = game:GetService('ReplicatedStorage'):WaitForChild('LVL')
XP = player:WaitForChild'leaderstats':WaitForChild'XP'
function HealthChanged()
local from,needed = RF:InvokeServer() -- this redirects to the function in script
local localxp = XP.Value
print(from,needed,localxp)
--UDim2.fromScale(0,1):Lerp(UDim2.fromScale(1,1),localxp/needed)
local UDim = UDim2.fromScale(XP.Value / needed,1) -- problem
script.Parent.TextLabel.Text = localxp..' / '..needed
script.Parent.Frame.Size = UDim
end
HealthChanged()
XP.Changed:Connect(HealthChanged)
while task.wait(10) do
HealthChanged()
end
-- script
function lvl(player)
local localXP = player.leaderstats.XP.Value
local LEVEL = player.leaderstats.LEVEL
local localLEVEL = LEVEL.Value
local needle = ((localLEVEL ^ 2) * 250) + 250
local negativeOne = (((localLEVEL-1) ^ 2) * 250) + 250
negativeOne = if localLEVEL <= 0 then 0 else negativeOne
if localXP >= needle then
LEVEL.Value += 1
return negativeOne,needle
end
return negativeOne,needle
end
i dont know what to add