Advertisement
Sungmingamerpro13

Waiting For Players(LocalScript)

Aug 18th, 2023
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.64 KB | None | 0 0
  1. local WaitingForPlayersEvent = game.ReplicatedStorage.WaitingForPlayersEvent
  2. local Values = game.ReplicatedStorage:WaitForChild("Values")
  3. local PlayersLeft = Values:WaitForChild("PlayersLeft")
  4. local TimerLeft = Values:WaitForChild("TimeLeft")
  5.  
  6. local WaitingFrame = script.Parent.WaitingFrame
  7.  
  8. WaitingForPlayersEvent.OnClientEvent:Connect(function(Text)
  9.     WaitingFrame.PlayersLeft.Text = Text
  10. end)
  11.  
  12. TimerLeft:GetPropertyChangedSignal("Value"):Connect(function()
  13.     if TimerLeft.Value == "0" then
  14.         WaitingFrame.Visible = false
  15.     else
  16.         WaitingFrame:TweenPosition(UDim2.new(0,0,0,0),.1)
  17.         WaitingFrame.TimeLeft.Text = TimerLeft.Value
  18.     end
  19. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement