Advertisement
SxScripting

DiedRemoteEvent

Feb 26th, 2021
1,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. local Events = game.ReplicatedStorage.Events
  2. local Debounce = {}
  3.  
  4. Events.DiedFired.OnServerEvent:Connect(function(Player)
  5. if Debounce[Player] then return end
  6. Debounce[Player] = true
  7.  
  8. local Lives = Player:WaitForChild("SystemFolder"):WaitForChild("Lives")
  9. Lives.Value -= 1
  10.  
  11. Player.CharacterAdded:Connect(function()
  12. if Lives.Value == 0 then
  13. spawn(function()
  14. Player.Character.HumanoidRootPart.Position = game.Workspace.NoLifePart.Position
  15. end)
  16. end
  17. end)
  18.  
  19. wait(.25)
  20. Debounce[Player] = nil
  21. end)
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement