Advertisement
SxScripting

Local Script [GUI]

Feb 16th, 2021
1,697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local PlayerGui = Player:WaitForChild("PlayerGui")
  3. local StatTextButton = PlayerGui.StatButton:WaitForChild("DisplayFrame").TextButton
  4. local ShowStatFrame = PlayerGui:WaitForChild("ShowStats").ShowStatsFrame
  5.  
  6. local StrengthValue = Player:WaitForChild("PowerFolder").Strength
  7. local DefenseValue = Player:WaitForChild("PowerFolder").Defense
  8.  
  9. local StrengthLabel = ShowStatFrame.StrengthNumber
  10. local DefenseLabel = ShowStatFrame.DefenseNumber
  11.  
  12. local function UpdateStats()
  13. ShowStatFrame.Visible = not ShowStatFrame.Visible
  14. StrengthLabel.Text = tostring(StrengthValue.Value)
  15. DefenseLabel.Text = tostring(DefenseValue.Value)
  16. end
  17.  
  18. StatTextButton.MouseButton1Click:Connect(UpdateStats)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement