xmaanzach

LocalScript [XP BAR]

Jul 29th, 2019
1,021
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. -- Script by xmaanzach
  2.  
  3. local Player = game.Players.LocalPlayer
  4.  
  5. local Nivel = Player.leaderstats:WaitForChild("Nivel")
  6. local Experiencia = Player.leaderstats:WaitForChild("Experiencia")
  7. local Xpn = Player.leaderstats:WaitForChild("ExpNeeded")
  8.  
  9. local NivelTxt = script.Parent.Nivel
  10. local Barra = script.Parent.XPBar.Barra
  11. local ExpTxt = script.Parent.XPBar.EXP
  12.  
  13. --// Actualizando la barra de experiencia constantemente //--
  14.  
  15. while wait() do
  16.  
  17. local BarSize = (Experiencia.Value/Xpn.Value) - 0.02
  18. if Experiencia.Value == 0 then
  19. BarSize = 0
  20. Barra:TweenSize(UDim2.new(BarSize, 0, 0, 30), "Out", "Quad", 0.25)
  21. else
  22. Barra:TweenSize(UDim2.new(BarSize, 0, 0, 30), "Out", "Quad", 0.25)
  23. end
  24.  
  25. ExpTxt.Text = "EXP: " .. Experiencia.Value .. "/" .. Xpn.Value
  26. NivelTxt.Text = "Nivel: " .. Nivel.Value
  27. end
Advertisement
Add Comment
Please, Sign In to add comment