Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.LocalPlayer:WaitForChild(script.Parent)
- --< [[ World Variables ]] >--
- PlayerGui = game.Players.LocalPlayer.PlayerGui
- --< [[ Custom Variables ]] >--
- -- Kin --
- Kin = script.Parent.Values.Kin
- KinDisplay = PlayerGui.HeadsUpDisplay.Main.Kin
- -- Experience --
- Level = script.Parent.Values.Level
- Experience = Level.Experience
- MaxExperience = Level.MaxExperience
- ExperienceBar = PlayerGui.HeadsUpDisplay.Main.Experience
- LevelDisplay = PlayerGui.HeadsUpDisplay.Main.Level
- ExpSize = UDim2.new(0, 11, 0, (Experience.Value * 63)/MaxExperience.Value * -1)
- MaxE = {
- 50, 63, 78, 98, 122, -- Lv 1 - 5
- 153, 191, 238, 298, 373, -- Lv 6 - 10
- 466, 582, 728, 910, 1137, -- Lv 11 - 15
- 1421, 1776, 2221, 2776, 3470 -- Lv 16 - 20
- }
- -- Magic --
- Magic = script.Parent.Values.Magic
- MagicRegen = Magic.MagicRegen
- MaxMagic = Magic.MaxMagic
- MagicBar = PlayerGui.HeadsUpDisplay.Main.Magic
- MagicSize = UDim2.new(0, 20, 0, (Magic.Value * 100)/MaxMagic.Value * -1)
- MaxM = {
- 100, 115, 130, 150, 175, -- Lv 1 - 5
- 200, 230, 265, 305, 350, -- Lv 6 - 10
- 405, 465, 535, 615, 710, -- Lv 11 - 15
- 815, 935, 1075, 1240, 1425 -- Lv 16 - 20
- }
- --< [[ Coroutines ]] >--
- -- Assign Experience --
- coroutine.create(coroutine.resume(function()
- while wait(.1) do
- MaxExperience.Value = MaxE[Level.Value]
- LevelDisplay.Text = Level.Value
- if (Experience.Value >= MaxExperience.Value) then
- Experience.Value = 0
- Level.Value = Level.Value + 1
- end
- ExperienceBar:TweenSize(ExpSize, "In", "Sine", .1)
- end
- end))
- -- Assign Magic & Kin --
- coroutine.create(coroutine.resume(function()
- while wait(.1) do
- MaxMagic.Value = MaxM[Level.Value]
- MagicRegen.Value = MaxMagic.Value / 80
- if (Magic.Value < MaxMagic.Value) then
- Magic.Value = Magic.Value + (MagicRegen.Value / 10)
- end
- MagicBar:TweenSize(MagicSize, "In", "Sine", .1)
- if Kin.Value < 1000 and Kin.Value > -1 then
- KinDisplay.Text = Kin.Value
- elseif Kin.Value < 1000000 and Kin.Value > 999 then
- local length = string.len(tostring(Kin.Value))
- KinDisplay.Text = string.sub(tostring(Kin.Value), 1, length - 3) .. "," .. string.sub(tostring(Kin.Value), length - 2)
- elseif Kin.Value < 10000000 and Kin.Value > 999999 then
- local length = string.len(tostring(Kin.Value))
- KinDisplay.Text = string.sub(tostring(Kin.Value), 1, length - 6) .. "," .. string.sub(tostring(Kin.Value), length - 5, length - 3) .. "," .. string.sub(tostring(Kin.Value), length - 2)
- elseif Kin.Value > 9999999 then
- KinDisplay.Text = "E-KL-OF"
- elseif Kin.Value < 0 then
- KinDisplay.Text = "E-KL-UF"
- end
- end
- end))
Add Comment
Please, Sign In to add comment