Facebook
From xBrickyyy, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 56
  1. ```lua
  2. local Players = game:GetService("Players");
  3. local Player = Players.LocalPlayer;
  4. local PlayerGui = Player:WaitForChild("PlayerGui")
  5.  
  6. local ProfileFrame = PlayerGui:WaitForChild('PlayerProfile'):WaitForChild("ProfileFrame");
  7. script.Parent.OpenProfile.MouseButton1Click:Connect(function()
  8.     ProfileFrame.Visible = not ProfileFrame.Visible;
  9. end)
  10.  
  11. local wins = Player:WaitForChild("leaderstats"):WaitForChild("Wins");
  12. local points = Player:WaitForChild("leaderstats"):WaitForChild("Points");
  13.  
  14. function updateUI()
  15.     ProfileFrame:WaitForChild("PlayerPoints").Text = ("You have ".. points.Value .." points!")
  16.     ProfileFrame:WaitForChild("ProfileFrame").PlayerWins.Text = "You have "..wins.Value.." wins!"
  17. end;
  18. updateUI();
  19.  
  20. wins:GetPropertyChangedSignal("Value"):Connect(updateUI);
  21.  
  22. points:GetPropertyChangedSignal("Value"):Connect(updateUI);
  23. ```