This is in a xp.Changed function. I have tried a few different ways but none of them work the way I want them too.
bob = 1/(xpneeded-xpgained) bar.Size = UDim2.new(bob,0,0,0)
Want I am trying to do: xp bar is increased by a steady % depending the the xpgained. I said steady because in one of my failed attempts it doubled the intervals in the xp bar everytime xp was gained.
Please if you have experience with xp bars or think you know a good way I am able to do this cause you're better at maths and logic than me please give it a go. The place I am making this for is my Nature game.
Try this:
bob = 1*(xpneeded/xpgained) bar.Size = UDIm2.new(bob,0,0,0)
If you're going to keep using the x scale value of UDim2, you can remove the "1*" too.
bob = xpneeded/xpgained bar.Size = UDIm2.new(bob,0,0,0)
Also, make sure you have something in the y scale or y offset values for the size or you won't see any xp bar at all.
For a smoother effect, you may want to experiment with Tweening too.