nwmcytatynormalnie

2

Aug 22nd, 2026
17
0
Never
Not a member of GistPad yet? Sign Up, it unlocks many cool features!
None 14.51 KB | None | 0 0
  1. local P = game:GetService("Players")
  2. local R = game:GetService("ReplicatedStorage")
  3. local T = game:GetService("TextChatService")
  4. local LP = P.LocalPlayer
  5. local PG = LP:WaitForChild("PlayerGui")
  6.  
  7. if PG:FindFirstChild("DQuiz") then PG.DQuiz:Destroy() end
  8.  
  9. local SG = Instance.new("ScreenGui")
  10. SG.Name = "DQuiz"
  11. SG.Parent = PG
  12. SG.ResetOnSpawn = false
  13.  
  14. local F = Instance.new("Frame")
  15. F.Parent = SG
  16. F.BackgroundColor3 = Color3.fromRGB(30,30,35)
  17. F.Position = UDim2.new(0.1, 0, 0.2, 0)
  18. F.Size = UDim2.new(0, 220, 0, 140)
  19. F.Active = true
  20. F.Draggable = true
  21.  
  22. local C1 = Instance.new("UICorner")
  23. C1.CornerRadius = UDim.new(0, 12)
  24. C1.Parent = F
  25.  
  26. local TL = Instance.new("TextLabel")
  27. TL.Parent = F
  28. TL.BackgroundTransparency = 1
  29. TL.Size = UDim2.new(1, 0, 0, 35)
  30. TL.Font = Enum.Font.GothamBold
  31. TL.Text = "Delta Trivia Bot"
  32. TL.TextColor3 = Color3.fromRGB(255, 255, 255)
  33. TL.TextSize = 16
  34.  
  35. local SL = Instance.new("TextLabel")
  36. SL.Parent = F
  37. SL.BackgroundTransparency = 1
  38. SL.Position = UDim2.new(0, 0, 0, 35)
  39. SL.Size = UDim2.new(1, 0, 0, 25)
  40. SL.Font = Enum.Font.Gotham
  41. SL.Text = "System Idle"
  42. SL.TextColor3 = Color3.fromRGB(180, 180, 180)
  43. SL.TextSize = 12
  44.  
  45. local B = Instance.new("TextButton")
  46. B.Parent = F
  47. B.BackgroundColor3 = Color3.fromRGB(220, 50, 50)
  48. B.Position = UDim2.new(0.1, 0, 0.55, 0)
  49. B.Size = UDim2.new(0.8, 0, 0, 45)
  50. B.Font = Enum.Font.Gotham
  51. B.Text = "Quiz: OFF"
  52. B.TextColor3 = Color3.fromRGB(255, 255, 255)
  53. B.TextSize = 14
  54.  
  55. local C2 = Instance.new("UICorner")
  56. C2.CornerRadius = UDim.new(0, 8)
  57. C2.Parent = B
  58.  
  59. local quizEnabled = false
  60. local currentQuestion = nil
  61. local currentSectorIndex = 1
  62. local usedInCurrentSector = {}
  63. local connections = {}
  64.  
  65. local sectors = {
  66. {
  67. N = "HISTORY",
  68. Q = {
  69. {Q = "Which long river was vital to ancient Egypt?", A = "nile"},
  70. {Q = "Who was the first president of the United States?", A = "washington"},
  71. {Q = "Which ancient empire built the Colosseum?", A = "roman"},
  72. {Q = "What famous wall in Germany fell down near the end of the eighties?", A = "berlin"}
  73. }
  74. },
  75. {
  76. N = "GEOGRAPHY",
  77. Q = {
  78. {Q = "What is the capital city of Australia?", A = "canberra"},
  79. {Q = "Which ocean is the deepest on Earth?", A = "pacific"},
  80. {Q = "What is the largest country by land mass?", A = "russia"},
  81. {Q = "What country has the capital city named Paris?", A = "france"}
  82. }
  83. },
  84. {
  85. N = "SCIENCE",
  86. Q = {
  87. {Q = "Which element has the atomic symbol Au?", A = "gold"},
  88. {Q = "Which planet is the hottest in our solar system?", A = "venus"},
  89. {Q = "What is the closest star to Earth?", A = "sun"},
  90. {Q = "What force keeps humans pulled down to the ground?", A = "gravity"}
  91. }
  92. }
  93. }
  94.  
  95. local function send(txt)
  96. if T.ChatVersion == Enum.ChatVersion.TextChatService then
  97. local c = T:FindFirstChild("TextChannels") and T.TextChannels:FindFirstChild("RBXGeneral")
  98. if c then c:SendAsync(txt) end
  99. else
  100. local r = R:FindFirstChild("DefaultChatSystemChatEvents") and R.DefaultChatSystemChatEvents:FindFirstChild("SayMessageRequest")
  101. if r then r:FireServer(txt, "All") end
  102. end
  103. end
  104.  
  105. local function hook(p)
  106. if p == LP then return end
  107. connections[p] = p.Chatted:Connect(function(m)
  108. if not quizEnabled or not currentQuestion then return end
  109. if string.find(string.lower(m), string.lower(currentQuestion.A)) then
  110. local ans = currentQuestion.A
  111. currentQuestion = nil
  112. send("Yes " .. p.Name .. "! The answer was " .. string.upper(ans) .. ".")
  113. end
  114. end)
  115. end
  116.  
  117. for _, p in ipairs(P:GetPlayers()) do hook(p) end
  118. P.PlayerAdded:Connect(hook)
  119. P.PlayerRemoving:Connect(function(p)
  120. if connections[p] then
  121. connections[p]:Disconnect()
  122. connections[p] = nil
  123. end
  124. end)
  125.  
  126. B.MouseButton1Click:Connect(function()
  127. quizEnabled = not quizEnabled
  128. if quizEnabled then
  129. B.Text = "Quiz: ON"
  130. B.BackgroundColor3 = Color3.fromRGB(50, 180, 50)
  131. else
  132. B.Text = "Quiz: OFF"
  133. B.BackgroundColor3 = Color3.fromRGB(220, 50, 50)
  134. currentQuestion = nil
  135. SL.Text = "System Idle"
  136. end
  137. end)
  138.  
  139. task.spawn(function()
  140. while true do
  141. task.wait(1)
  142. if quizEnabled and not currentQuestion then
  143. local sec = sectors[currentSectorIndex]
  144.  
  145. if #usedInCurrentSector >= #sec.Q then
  146. usedInCurrentSector = {}
  147. currentSectorIndex = currentSectorIndex + 1
  148. if currentSectorIndex > #sectors then currentSectorIndex = 1 end
  149. sec = sectors[currentSectorIndex]
  150. send("[SYSTEM] Shifting to Sector: " .. sec.N)
  151. task.wait(3)
  152. end
  153.  
  154. local avail = {}
  155. for _, q in ipairs(sec.Q) do
  156. local u = false
  157. for _, v in ipairs(usedInCurrentSector) do
  158. if v.Q == q.Q then u = true break end
  159. end
  160. if not u then table.insert(avail, q) end
  161. end
  162.  
  163. if #avail > 0 then
  164. currentQuestion = avail[math.random(1, #avail)]
  165. table.insert(usedInCurrentSector, currentQuestion)
  166. SL.Text = sec.N .. " Sector"
  167. send("[" .. sec.N .. "] QUIZ: " .. currentQuestion.Q)
  168.  
  169. local t = 25
  170. while t > 0 and currentQuestion and quizEnabled do
  171. task.wait(1)
  172. t = t - 1
  173. SL.Text = "Time Left: " .. t .. "s"
  174. end
  175.  
  176. if currentQuestion and quizEnabled then
  177. send("Time out! The correct answer was: " .. string.upper(currentQuestion.A))
  178. currentQuestion = nil
  179. end
  180. end
  181. end
  182. end
  183. end)
RAW Paste Data Copied