Advertisement
Meliodas0_0

Phantom Forces Scorekeeper

Sep 16th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.71 KB | None | 0 0
  1. --features
  2. --u can see ur kills
  3. --u can see ur xp
  4. --u have a little bar to see level progress
  5.  
  6. local PFS = Instance.new("ScreenGui")
  7.  
  8. do
  9.     local Frame = Instance.new("Frame")
  10.     local Experience = Instance.new("TextLabel")
  11.     local Rank = Instance.new("TextLabel")
  12.     local Kills = Instance.new("TextLabel")
  13.     local Progress = Instance.new("TextLabel")
  14.     local Money = Instance.new("TextLabel")
  15.     local Details = Instance.new("TextLabel")
  16.     local Bar = Instance.new("Frame")
  17.     local Filler = Instance.new("Frame")
  18.    
  19.     PFS.Name = "PFS"
  20.     PFS.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  21.     PFS.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  22.     PFS.ResetOnSpawn = false
  23.    
  24.     Frame.Parent = PFS
  25.     Frame.AnchorPoint = Vector2.new(1, 0.5)
  26.     Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  27.     Frame.BackgroundTransparency = 1
  28.     Frame.Position = UDim2.new(1, -5, 0.5, 0)
  29.     Frame.Size = UDim2.new(0, 200, 0, 100)
  30.    
  31.     Experience.Name = "Experience"
  32.     Experience.Parent = Frame
  33.     Experience.BackgroundColor3 = Color3.new(1, 1, 1)
  34.     Experience.BackgroundTransparency = 1
  35.     Experience.Position = UDim2.new(0, 0, 0, 15)
  36.     Experience.Size = UDim2.new(0, 200, 0, 15)
  37.     Experience.Font = Enum.Font.Code
  38.     Experience.Text = "Experience: 3503283"
  39.     Experience.TextColor3 = Color3.new(1, 1, 1)
  40.     Experience.TextSize = 14
  41.     Experience.TextStrokeTransparency = 0.69999998807907
  42.     Experience.TextXAlignment = Enum.TextXAlignment.Right
  43.    
  44.     Rank.Name = "Rank"
  45.     Rank.Parent = Frame
  46.     Rank.BackgroundColor3 = Color3.new(1, 1, 1)
  47.     Rank.BackgroundTransparency = 1
  48.     Rank.Size = UDim2.new(0, 200, 0, 15)
  49.     Rank.Font = Enum.Font.Code
  50.     Rank.Text = "Rank: 84"
  51.     Rank.TextColor3 = Color3.new(1, 1, 1)
  52.     Rank.TextSize = 14
  53.     Rank.TextStrokeTransparency = 0.69999998807907
  54.     Rank.TextXAlignment = Enum.TextXAlignment.Right
  55.    
  56.     Kills.Name = "Kills"
  57.     Kills.Parent = Frame
  58.     Kills.BackgroundColor3 = Color3.new(1, 1, 1)
  59.     Kills.BackgroundTransparency = 1
  60.     Kills.Position = UDim2.new(0, 0, 0, 30)
  61.     Kills.Size = UDim2.new(0, 200, 0, 15)
  62.     Kills.Font = Enum.Font.Code
  63.     Kills.Text = "Kills: 20012"
  64.     Kills.TextColor3 = Color3.new(1, 1, 1)
  65.     Kills.TextSize = 14
  66.     Kills.TextStrokeTransparency = 0.69999998807907
  67.     Kills.TextXAlignment = Enum.TextXAlignment.Right
  68.    
  69.     Progress.Name = "Progress"
  70.     Progress.Parent = Frame
  71.     Progress.BackgroundColor3 = Color3.new(1, 1, 1)
  72.     Progress.BackgroundTransparency = 1
  73.     Progress.Position = UDim2.new(0, 0, 0, 75)
  74.     Progress.Size = UDim2.new(0, 200, 0, 15)
  75.     Progress.Font = Enum.Font.Code
  76.     Progress.Text = "Progress"
  77.     Progress.TextColor3 = Color3.new(1, 1, 1)
  78.     Progress.TextSize = 14
  79.     Progress.TextStrokeTransparency = 0.69999998807907
  80.     Progress.TextXAlignment = Enum.TextXAlignment.Right
  81.    
  82.     Money.Name = "Money"
  83.     Money.Parent = Frame
  84.     Money.BackgroundColor3 = Color3.new(1, 1, 1)
  85.     Money.BackgroundTransparency = 1
  86.     Money.Position = UDim2.new(0, 0, 0, 45)
  87.     Money.Size = UDim2.new(0, 200, 0, 15)
  88.     Money.Font = Enum.Font.Code
  89.     Money.Text = "Credits: 3503283"
  90.     Money.TextColor3 = Color3.new(1, 1, 1)
  91.     Money.TextSize = 14
  92.     Money.TextStrokeTransparency = 0.69999998807907
  93.     Money.TextXAlignment = Enum.TextXAlignment.Right
  94.    
  95.     Details.Name = "Details"
  96.     Details.Parent = Frame
  97.     Details.BackgroundColor3 = Color3.new(1, 1, 1)
  98.     Details.BackgroundTransparency = 1
  99.     Details.Position = UDim2.new(0, 0, 0, 90)
  100.     Details.Size = UDim2.new(0, 200, 0, 15)
  101.     Details.Font = Enum.Font.Code
  102.     Details.Text = "24385/85000 XP"
  103.     Details.TextColor3 = Color3.new(1, 1, 1)
  104.     Details.TextSize = 14
  105.     Details.TextStrokeTransparency = 0.69999998807907
  106.     Details.TextXAlignment = Enum.TextXAlignment.Right
  107.    
  108.     Bar.Name = "Bar"
  109.     Bar.Parent = Frame
  110.     Bar.BackgroundColor3 = Color3.new(0.266667, 0.266667, 0.266667)
  111.     Bar.BorderSizePixel = 0
  112.     Bar.Position = UDim2.new(0, 0, 0, 63)
  113.     Bar.Size = UDim2.new(1, 0, 0, 10)
  114.    
  115.     Filler.Name = "Filler"
  116.     Filler.Parent = Bar
  117.     Filler.AnchorPoint = Vector2.new(1, 0)
  118.     Filler.BackgroundColor3 = Color3.new(1, 1, 1)
  119.     Filler.BorderSizePixel = 0
  120.     Filler.Position = UDim2.new(1, 0, 0, 0)
  121.     Filler.Size = UDim2.new(0, 0, 0, 10)
  122. end
  123.  
  124. local client = {}
  125. local localPlayer = game:GetService("Players").LocalPlayer
  126.  
  127. local gc, getup, setup, getreg = getgc, debug.getupvalues, debug.setupvalues
  128.  
  129. local function calculateRank(points)
  130.     points=points or 0
  131.     return math.floor((1/4+points/500)^0.5-1/2)
  132. end
  133.  
  134. local function calculateExp(rank)
  135.     rank=rank or 0
  136.     return math.floor(500*((rank+1/2)^2-1/4))
  137. end
  138.  
  139. local ui = PFS.Frame
  140. local ts = game:GetService("TweenService")
  141.  
  142. for index, value in next, gc() do
  143.   for xd, newvalue in next, getup(value) do
  144.     if type(newvalue) == "table" then
  145.       for func, fvalue in next, newvalue do
  146.                 if func == "stats" then
  147.           client.hasstats = newvalue
  148.         end
  149.       end
  150.     end
  151.   end
  152. end
  153.  
  154. if client then
  155.   local char = client.char
  156.   local network = client.network
  157.   local effects = client.effects
  158.   local send = network.send
  159.   local LG = char.loadgun
  160.   local LF = char.loadgrenade
  161.  
  162.   for i, v in next, client.hasstats.stats do
  163.     print(i, v)
  164.   end
  165.  
  166.   while wait() do
  167.     local exp = client.hasstats.stats.experience
  168.     local kills = client.hasstats.stats.totalkills
  169.     local money = client.hasstats.stats.money
  170.     local expHave = exp - calculateExp(calculateRank(exp))
  171.     local expNeed = calculateExp(calculateRank(exp) + 1) - calculateExp(calculateRank(exp))
  172.        
  173.     ui.Experience.Text = "Experience: " .. exp
  174.     ui.Rank.Text = "Rank: ".. calculateRank(exp)
  175.     ui.Kills.Text = "Kills: ".. kills
  176.     ui.Credits.Text = "Credits: ".. money
  177.     ui.Details.Text = expHave .. " / " .. expNeed .. " EXP"
  178.     ts:Create(ui.Bar.Filler, TweenInfo.new(0.1, Enum.EasingStyle.Sine), {Size = UDim2.new(expHave / expNeed, 0, 0, 10), BackgroundColor3 = Color3.fromHSV(expHave / expNeed * 0.4, 0.75, 1)}):Play()
  179.   end
  180. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement