Mryeetmemes

LoseGUI Script

Dec 9th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. local Workspace = game:GetService("Workspace")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3.  
  4. local Map = Workspace:WaitForChild("Map")
  5. local Path = Map:WaitForChild("Path")
  6. local Arrows = Map:WaitForChild("Arrows")
  7. local Sounds = Map:WaitForChild("Sounds")
  8. local Configuration = Map:WaitForChild("Configuration")
  9.  
  10. script.Parent.Parent.Enabled = false
  11.  
  12. Configuration.Health.Changed:Connect(function()
  13.     if Configuration.Health.Value <= 0 then
  14.         script.Parent.Parent.Enabled = true
  15.         if Sounds.Lose.Playing == false then
  16.             Sounds.Lose:Play()
  17.             wait(15)
  18.             game.Players.LocalPlayer:Kick("You Lost, you can rejoin to play again!")
  19.         end
  20.     end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment