Advertisement
SxScripting

GUI Script

Feb 26th, 2021
3,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Lives = Player:WaitForChild("SystemFolder").Lives
  3. local PlayerGui = Player:WaitForChild("PlayerGui")
  4. local TextDisplay = script.Parent.TextDisplay
  5.  
  6. local Character = Player.Character or Player.CharacterAdded:Wait()
  7. local Humanoid = Character:WaitForChild("Humanoid")
  8.  
  9. local function LivesChangingDisplay()
  10. TextDisplay.Text = "Lives: "..Lives.Value
  11. end
  12.  
  13. LivesChangingDisplay()
  14. Lives.Changed:Connect(LivesChangingDisplay)
  15.  
  16. Humanoid.Died:Connect(function()
  17. game.ReplicatedStorage.Events.DiedFired:FireServer()
  18. end)
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement