kob123678

Longest Answer Wins (Delay)

Mar 5th, 2023
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2.  
  3. local hintAnswer = ReplicatedStorage.HintAnswer
  4. local submitAnswer = ReplicatedStorage.SubmittedAnswer
  5.  
  6. local function answerQuestion()
  7. local correctAnswer = hintAnswer.Value
  8. local answerLength = #correctAnswer
  9.  
  10. task.wait(math.random(20, 30) / 10 + answerLength / 5) -- 2 - 3s of "thinking", typing speed at 5 cps (average)
  11.  
  12. submitAnswer:FireServer(correctAnswer, answerLength)
  13. end
  14.  
  15. answerQuestion()
  16.  
  17. hintAnswer:GetPropertyChangedSignal("Value"):Connect(answerQuestion)
Add Comment
Please, Sign In to add comment