local abbreviations = {"", "K", "M", "B", "Qa", "Qi", "Sx", "Sp", "Oc", "No", "Dc", "Un", "Duo", "Tre", "Qua", "Qui", "Sed", "Sep", "Oct", "Nov", "V"}
local function Format(value, idp)
local ex = math.floor(math.log(math.max(1, math.abs(value)),1000))
local abbrevs = abbreviations [1 + ex] or ("e+"..ex)
local normal = math.floor(value * ((10 ^ idp) / (1000 ^ ex))) / (10 ^ idp)
return ("%."..idp.."f%s"):format(normal, abbrevs)
end
local currentAmount = 0
local currentCoinAmount = 0
local plr = game.Players.LocalPlayer
local leaderstats = plr:FindFirstChild("leaderstats")
local ts =game:GetService("TweenService")
task.wait(3)
plr.leaderstats.experience.Changed:Connect(function()
task.delay(0.2, function()
if currentAmount ~= leaderstats.experience.Value then
local rando = math.random(1,1500)
local randox = rando/ 1400
local NewLabel = game.ReplicatedStorage.ExpPopup:Clone()
NewLabel.Parent = script.Parent
ts:Create(NewLabel,TweenInfo.new(0.2,Enum.EasingStyle.Cubic), {Size = UDim2.new(0.070, 0,0.120, 0)}):Play()
NewLabel.Position = UDim2.new(randox,randox,randox,randox)
ts:Create(NewLabel,TweenInfo.new(0.3,Enum.EasingStyle.Cubic),{Rotation = 95}):Play()
NewLabel.ExpTextPopUp.Text = Format(plr.leaderstats.experience.Value - currentAmount,1)
currentAmount = plr.leaderstats.experience.Value
ts:Create(NewLabel,TweenInfo.new(0.3,Enum.EasingStyle.Cubic),{Rotation = 0}):Play()
task.wait(0.3)
ts:Create(NewLabel,TweenInfo.new(0.3,Enum.EasingStyle.Cubic), {Size = UDim2.new(0,0,0,0)}):Play()
ts:Create(NewLabel,TweenInfo.new(0.3,Enum.EasingStyle.Cubic),{ImageTransparency =1}):Play()
ts:Create(NewLabel.ExpTextPopUp,TweenInfo.new(0.6,Enum.EasingStyle.Cubic),{TextTransparency =1}):Play()
ts:Create(NewLabel.ExpTextPopUp.UIStroke,TweenInfo.new(0.6,Enum.EasingStyle.Cubic),{Transparency =1}):Play()
game.Debris:AddItem(NewLabel, .35)
end
end)
end)
this is called when the leaderstats is changed and creates a pop up on the screen after doing this for a while it stars to drop fps. does anybody know why? it is whenever the pop up appears and tweens.