How to Make a XP Bar

In Roblox 44 views

For those whoa re looking for the method of how to make the XP bar, you are in the right place as you will be informed about it. Please read everything well and do not miss a single thing even just a word.

In order to make the XP bar, here are all the steps that you have to do. First,  insert the script inside the workspace. The screen you are about to make is the leaderboard for level and exp. The script for this will be in the desc but it is better if you follow along and understand what is happening

  1. game.Players,PlayersAdded=connect (function (Player)
  2. local Leaderstats =“IntValue”, Player)
  3. Leaderstats.Name = “Leaderstats”
  4. local Level =“IntValue”, Leaderstats)
  5. Level.Name = “Level”
  6. Level.Value = 1
  7. Local Exp =“IntValue”, Leaderstats)
  8. Exp.Name = “Exp”
  9. Exp.Value = 0
  10. Exp.Changed.connect (function) ExpChange (Player.Exp.Level) and)
  11. And)
  12. Function ExpChange (Player.Exp.Level)
  13. If Exp.Value >= Level.Value*200 then
  14. Exp.Value = 0
  15. Level.Value = Level.Value + 1
  16. end
  17. end

You can change *200 to what you want the exp to be so players can level up. Aside from that, you are also able to change +1 to whatever you want the level of the player to be once they level up. For instance: Level 1 + 1 = Level 2.

Second, go to Starter GUI and insert the Screen GUI. You can rename it to the exp if you like. Third, insert the frame inside of the Screen GUI. Please change the size to (0,1), (0,20) and the position to (0,0), (1,30). Fourth, insert another frame inside the Screen GUI. You have to change the size to (0.1), (0,20). Fifth, insert the script inside of the second frame:

  1. Exp = script.Parent.Parent.Parent.Parent.Leaderstate.Exp
  2. Level = script.Parent.Parent.Parent.Parent.Leaderstate.Level
  3. while true do
  4. wait ()
  5. local pie = ( Exp. Value / (Level.Value *200 + 1) )
  6. script.Parent.Size = pie, 0, 0, 20)
  7. end

Please keep in mind that this script is just to display the amount of exp needed to level up and the current exp players have. Sixth, go back to the first frame and this time insert the text label. Seventh, change the size to (0,1), (0,20). Eighth, change the font to whatever you like. Also, you can turn on the text scaled and make sure the text is blank. Ninth, insert the script inside the text label. This one will change the exp value once you level up. Tenth, insert the Screen GUI. Eleventh, rename it to the level if you like. Twelfth, insert the text label inside the second Screen GUI. Thirteenth, change the position to (0,10), (0,400). Fourteenth, insert the script inside the text label. Fifteenth, go back to the text label properties. Sixteenth, change the background to 1 and text to level. Aside from that, you can also turn on the text scaled. Everything has to be done.

Spiderman Far From Home in Roblox
Spiderman Far From Home in Roblox
Spiderman: Far From Home is an upcoming
Roblox Crazy Fun House Obby
Roblox Crazy Fun House Obby
If you are at this page, you
Roblox Beach House Roleplay
Roblox Beach House Roleplay
Beach House Roleplay is a roleplay game

Leave a reply "How to Make a XP Bar"

Must read×