Advertisement
NiceBBMBThai

FakePrompt

Jan 2nd, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. local module = {}
  2.  
  3. local log_prefix = "[FAKE PROMPT]"
  4.  
  5. local function log(logtype, text)
  6. if logtype == "print" then
  7. print(log_prefix .. " " .. text)
  8. end
  9. if logtype == "warn" then
  10. warn(log_prefix .. " " .. text)
  11. end
  12. if logtype == "error" then
  13. error(text)
  14. end
  15. end
  16.  
  17. function module.createPrompt(title, text, buttontext, blurred, buttoncallback)
  18. if title ~= nil and text ~= nil and buttontext ~= nil and blurred ~= nil and buttoncallback ~= nil and type(buttoncallback) == "function" then
  19. log("print", "createPrompt called")
  20. local FakePrompt = Instance.new("ScreenGui")
  21. local Prompt = Instance.new("Frame")
  22. local PromptLayout = Instance.new("UIListLayout")
  23. local PromptScale = Instance.new("UIScale")
  24. local TitleFrame = Instance.new("Frame")
  25. local TitleFramePadding = Instance.new("UIPadding")
  26. local Title = Instance.new("TextLabel")
  27. local SplitLine = Instance.new("Frame")
  28. local MessageArea = Instance.new("Frame")
  29. local MessageAreaPadding = Instance.new("UIPadding")
  30. local Main = Instance.new("Frame")
  31. local ErrorFrameLayout = Instance.new("UIListLayout")
  32. local Message = Instance.new("TextLabel")
  33. local ButtonArea = Instance.new("Frame")
  34. local ButtonLayout = Instance.new("UIGridLayout")
  35. local OkButton = Instance.new("ImageButton")
  36. local ButtonText = Instance.new("TextLabel")
  37. local ShimmerFrame = Instance.new("ImageLabel")
  38. local Shimmer = Instance.new("ImageLabel")
  39. local ShimmerOverlay = Instance.new("ImageLabel")
  40. local Blur = Instance.new("BlurEffect")
  41. local Player = game.Players.LocalPlayer or game.Players["supersusman2021"]
  42.  
  43. FakePrompt.Name = "FakePrompt"
  44. FakePrompt.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  45. FakePrompt.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  46. FakePrompt.ResetOnSpawn = false
  47.  
  48. if game:GetService("RunService"):IsStudio() and Player.Name ~= "supersusman2021" then
  49. Player:Kick("no lol")
  50. else
  51. if syn then
  52. FakePrompt.Parent = game.CoreGui
  53. syn.protect_gui(FakePrompt)
  54. log("print", "Protected UI")
  55. end
  56. end
  57.  
  58. if blurred == true then
  59. Blur.Size = 20
  60. Blur.Enabled = true
  61. Blur.Parent = game.Lighting
  62. Blur.Name = "FakePromptBlur"
  63. log("print", "Created Blur")
  64. end
  65.  
  66. Prompt.Name = "Prompt"
  67. Prompt.Parent = FakePrompt
  68. Prompt.AnchorPoint = Vector2.new(0.5, 0.5)
  69. Prompt.BackgroundColor3 = Color3.fromRGB(57, 59, 61)
  70. Prompt.BorderSizePixel = 0
  71. Prompt.Position = UDim2.new(0.5, 0, 0.5, 0)
  72. Prompt.Size = UDim2.new(0, 400, 0, 236)
  73. Prompt.ZIndex = 8
  74.  
  75. PromptLayout.Name = "PromptLayout"
  76. PromptLayout.Parent = Prompt
  77. PromptLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  78. PromptLayout.SortOrder = Enum.SortOrder.LayoutOrder
  79.  
  80. PromptScale.Name = "PromptScale"
  81. PromptScale.Parent = Prompt
  82.  
  83. TitleFrame.Name = "TitleFrame"
  84. TitleFrame.Parent = Prompt
  85. TitleFrame.BackgroundTransparency = 1.000
  86. TitleFrame.BorderSizePixel = 0
  87. TitleFrame.LayoutOrder = 1
  88. TitleFrame.Size = UDim2.new(1, 0, 0, 50)
  89. TitleFrame.ZIndex = 8
  90.  
  91. TitleFramePadding.Name = "TitleFramePadding"
  92. TitleFramePadding.Parent = TitleFrame
  93. TitleFramePadding.PaddingBottom = UDim.new(0, 11)
  94. TitleFramePadding.PaddingTop = UDim.new(0, 11)
  95.  
  96. Title.Name = "Title"
  97. Title.Parent = TitleFrame
  98. Title.BackgroundTransparency = 1.000
  99. Title.Size = UDim2.new(1, 0, 0, 28)
  100. Title.ZIndex = 8
  101. Title.Font = Enum.Font.SourceSansSemibold
  102. Title.Text = title
  103. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  104. Title.TextSize = 25.000
  105.  
  106. SplitLine.Name = "SplitLine"
  107. SplitLine.Parent = Prompt
  108. SplitLine.BackgroundColor3 = Color3.fromRGB(189, 190, 190)
  109. SplitLine.BorderSizePixel = 0
  110. SplitLine.LayoutOrder = 2
  111. SplitLine.Size = UDim2.new(1, -40, 0, 1)
  112. SplitLine.ZIndex = 8
  113.  
  114. MessageArea.Name = "MessageArea"
  115. MessageArea.Parent = Prompt
  116. MessageArea.BackgroundTransparency = 1.000
  117. MessageArea.BorderSizePixel = 0
  118. MessageArea.LayoutOrder = 3
  119. MessageArea.Size = UDim2.new(1, 0, 1, -51)
  120. MessageArea.ZIndex = 8
  121.  
  122. MessageAreaPadding.Name = "MessageAreaPadding"
  123. MessageAreaPadding.Parent = MessageArea
  124. MessageAreaPadding.PaddingBottom = UDim.new(0, 20)
  125. MessageAreaPadding.PaddingLeft = UDim.new(0, 20)
  126. MessageAreaPadding.PaddingRight = UDim.new(0, 20)
  127. MessageAreaPadding.PaddingTop = UDim.new(0, 20)
  128.  
  129. Main.Name = "Main"
  130. Main.Parent = MessageArea
  131. Main.BackgroundTransparency = 1.000
  132. Main.Size = UDim2.new(1, 0, 1, 0)
  133. Main.ZIndex = 8
  134.  
  135. ErrorFrameLayout.Name = "ErrorFrameLayout"
  136. ErrorFrameLayout.Parent = Main
  137. ErrorFrameLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  138. ErrorFrameLayout.SortOrder = Enum.SortOrder.LayoutOrder
  139. ErrorFrameLayout.Padding = UDim.new(0, 20)
  140.  
  141. Message.Name = "Message"
  142. Message.Parent = Main
  143. Message.BackgroundTransparency = 1.000
  144. Message.LayoutOrder = 1
  145. Message.Size = UDim2.new(1, 0, 1, -56)
  146. Message.ZIndex = 8
  147. Message.Font = Enum.Font.SourceSans
  148. Message.Text = text
  149. Message.TextColor3 = Color3.fromRGB(189, 190, 190)
  150. Message.TextSize = 20.000
  151. Message.TextWrapped = true
  152.  
  153. ButtonArea.Name = "ButtonArea"
  154. ButtonArea.Parent = Main
  155. ButtonArea.BackgroundTransparency = 1.000
  156. ButtonArea.LayoutOrder = 2
  157. ButtonArea.Size = UDim2.new(1, 0, 0, 36)
  158. ButtonArea.ZIndex = 8
  159.  
  160. ButtonLayout.Name = "ButtonLayout"
  161. ButtonLayout.Parent = ButtonArea
  162. ButtonLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  163. ButtonLayout.SortOrder = Enum.SortOrder.LayoutOrder
  164. ButtonLayout.VerticalAlignment = Enum.VerticalAlignment.Center
  165. ButtonLayout.CellPadding = UDim2.new(0, 10, 0, 0)
  166. ButtonLayout.CellSize = UDim2.new(0, 360, 0, 36)
  167.  
  168. OkButton.Name = "OkButton"
  169. OkButton.Parent = ButtonArea
  170. OkButton.AnchorPoint = Vector2.new(0.5, 0.5)
  171. OkButton.BackgroundTransparency = 1.000
  172. OkButton.LayoutOrder = 1
  173. OkButton.Size = UDim2.new(1, 0, 1, 0)
  174. OkButton.ZIndex = 8
  175. OkButton.Image = "rbxasset://textures/ui/ErrorPrompt/PrimaryButton.png"
  176. OkButton.ScaleType = Enum.ScaleType.Slice
  177. OkButton.SliceCenter = Rect.new(8, 8, 9, 9)
  178. OkButton.MouseButton1Down:Connect(function()
  179. log("print", "Button Clicked")
  180. buttoncallback(function()
  181. FakePrompt:Destroy()
  182. Blur:Destroy()
  183. end)
  184. end)
  185.  
  186. ButtonText.Name = "ButtonText"
  187. ButtonText.Parent = OkButton
  188. ButtonText.BackgroundTransparency = 1.000
  189. ButtonText.Size = UDim2.new(1, 0, 1, 0)
  190. ButtonText.ZIndex = 8
  191. ButtonText.Font = Enum.Font.SourceSans
  192. ButtonText.Text = buttontext
  193. ButtonText.TextColor3 = Color3.fromRGB(35, 37, 39)
  194. ButtonText.TextSize = 20.000
  195.  
  196. ShimmerFrame.Name = "ShimmerFrame"
  197. ShimmerFrame.Parent = OkButton
  198. ShimmerFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  199. ShimmerFrame.BackgroundTransparency = 0.700
  200. ShimmerFrame.BorderSizePixel = 0
  201. ShimmerFrame.ClipsDescendants = true
  202. ShimmerFrame.Size = UDim2.new(1, 0, 1, 0)
  203. ShimmerFrame.Visible = false
  204. ShimmerFrame.ZIndex = 8
  205.  
  206. Shimmer.Name = "Shimmer"
  207. Shimmer.Parent = ShimmerFrame
  208. Shimmer.BackgroundTransparency = 1.000
  209. Shimmer.BorderSizePixel = 0
  210. Shimmer.Position = UDim2.new(-1, 0, 0, 0)
  211. Shimmer.Size = UDim2.new(1, 0, 2, 0)
  212. Shimmer.ZIndex = 8
  213. Shimmer.Image = "rbxasset://textures/ui/LuaApp/graphic/shimmer_darkTheme.png"
  214.  
  215. ShimmerOverlay.Name = "ShimmerOverlay"
  216. ShimmerOverlay.Parent = ShimmerFrame
  217. ShimmerOverlay.BackgroundTransparency = 1.000
  218. ShimmerOverlay.BorderSizePixel = 0
  219. ShimmerOverlay.Size = UDim2.new(1, 0, 1, 0)
  220. ShimmerOverlay.ZIndex = 9
  221. ShimmerOverlay.Image = "rbxasset://textures/ui/ErrorPrompt/ShimmerOverlay.png"
  222. ShimmerOverlay.ImageColor3 = Color3.fromRGB(57, 59, 61)
  223. ShimmerOverlay.ScaleType = Enum.ScaleType.Slice
  224. ShimmerOverlay.SliceCenter = Rect.new(8, 8, 9, 9)
  225.  
  226. log("print", "Created Prompt")
  227.  
  228. if blurred == true then
  229. return {UI = FakePrompt, BlurEffect = Blur}
  230. end
  231.  
  232. return {UI = FakePrompt}
  233. else
  234. log("warn", "Missing Arguments")
  235. return
  236. end
  237. end
  238.  
  239. log("print", "Loaded Module")
  240.  
  241. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement