Advertisement
Sungmingamerpro13

Math System for Story Games

May 25th, 2025 (edited)
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.90 KB | None | 0 0
  1. --- ServerScriptService ---
  2.  
  3. local ChatSystem = game.ReplicatedStorage.ChatSystem
  4.  
  5. game.Players.PlayerAdded:Connect(function(player)
  6.     player.Chatted:Connect(function(Message)
  7.         if Message == "5" then
  8.             if ChatSystem.ChatEnabled.Value == true and ChatSystem.CorrectFound.Value == false then
  9.                 ChatSystem.ChatEnabled.Value = false
  10.                 ChatSystem.CorrectFound.Value = true
  11.                 ChatSystem.PlayerName.Value = player.Name
  12.             end
  13.         end
  14.     end)
  15. end)
  16.  
  17. --- MainScript ---
  18.  
  19. local ChatSystem = game.ReplicatedStorage.ChatSystem
  20.  
  21. ChatSystem.ChatEnabled.Value = true
  22.  
  23. for i = 30, 0, -1 do
  24.     TimerValue.Value = i
  25.     wait(1)
  26.     if ChatSystem.CorrectFound.Value == true then
  27.         break
  28.     elseif i == 0 and ChatSystem.CorrectFound.Value == false then
  29.         RandomPlayer.Character.Humanoid.Health = 0
  30.     end
  31. end
  32.  
  33. repeat wait(0.1) until ChatSystem.CorrectFound.Value == true or RandomPlayer.Character.Humanoid.Health == 0
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement