Advertisement
HowToRoblox

BombTagGuiHandler

Dec 5th, 2022
1,306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local dataFailedWarning = script.Parent:WaitForChild("DataFailedWarning")
  2. dataFailedWarning.Enabled = false
  3.  
  4. local client = game.Players.LocalPlayer
  5.  
  6. client.ChildAdded:Connect(function(child)
  7.     if child.Name == "FAILED TO LOAD DATA" then
  8.         dataFailedWarning.Enabled = true
  9.     end
  10. end)
  11.  
  12.  
  13. local rs = game.ReplicatedStorage:WaitForChild("BombTagReplicatedStorage")
  14.  
  15. local statusValue = rs:WaitForChild("STATUS")
  16. local currentTagged = rs:WaitForChild("CURRENT TAGGED PLAYER")
  17. local bombTimer = rs:WaitForChild("EXPLODE TIMER")
  18.  
  19.  
  20. local mainGui = script.Parent:WaitForChild("BombTagGui")
  21. local textFrame = mainGui:WaitForChild("TextContainer")
  22. local statusLabel = textFrame:WaitForChild("Status")
  23. statusLabel.Visible = true
  24. local bombTimeLabel = textFrame:WaitForChild("BombExplodeTime")
  25. bombTimeLabel.Visible = false
  26.  
  27.  
  28. function updateStatus()
  29.     statusLabel.Text = statusValue.Value
  30. end
  31. updateStatus()
  32. statusValue:GetPropertyChangedSignal("Value"):Connect(updateStatus)
  33.  
  34.  
  35. function updateTimer()
  36.    
  37.     if currentTagged.Value == client.Character then
  38.        
  39.         statusLabel.Text = "You are tagged"
  40.         bombTimeLabel.Text = "You will explode in " .. bombTimer.Value .. " seconds!"
  41.        
  42.         bombTimeLabel.Visible = true
  43.     else
  44.         statusLabel.Text = statusValue.Value
  45.         bombTimeLabel.Visible = false
  46.     end
  47. end
  48.  
  49. bombTimer:GetPropertyChangedSignal("Value"):Connect(updateTimer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement