Advertisement
NightGolden

11

Mar 11th, 2023
76
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 KB | None | 1 0
  1. -- 创建屏幕Gui
  2. local CardSystemScreenGui = Instance.new("ScreenGui")
  3.  
  4. -- 创建框架
  5. local CardSystem = Instance.new("Frame")
  6.  
  7. -- 创建标题
  8. local Title = Instance.new("TextLabel")
  9.  
  10. -- 创建卡密标签
  11. local CardLabel = Instance.new("TextLabel")
  12.  
  13. -- 创建卡密输入框
  14. local CardEntry = Instance.new("TextBox")
  15.  
  16. -- 创建卡密输入框的圆角
  17. local CardEntryUICorner = Instance.new("UICorner")
  18.  
  19. -- 创建确定按钮
  20. local SubmitButton = Instance.new("TextButton")
  21.  
  22. -- 创建图片
  23. local CorrectIncorrectImageLabel = Instance.new("ImageLabel")
  24.  
  25. -- 创建图片圆角
  26. local ImageLabelUICorner = Instance.new("UICorner")
  27.  
  28. -- 创建确定按钮的圆角
  29. local SubmitButtonUICorner = Instance.new("UICorner")
  30.  
  31. -- 创建结果标签
  32. local ResultLabel = Instance.new("TextLabel")
  33.  
  34. -- 创建框架的圆角
  35. local CardSystemUICorner = Instance.new("UICorner")
  36.  
  37. -- 设置屏幕Gui
  38. CardSystemScreenGui.Name = "CardSystemScreenGui"
  39. CardSystemScreenGui.Parent = game.CoreGui
  40.  
  41. -- 设置框架
  42. CardSystem.Name = "CardSystem"
  43. CardSystem.Parent = CardSystemScreenGui
  44. CardSystem.BackgroundColor3 = Color3.fromRGB(44, 62, 80)
  45. CardSystem.BorderSizePixel = 0
  46. CardSystem.Position = UDim2.new(0.5, -200, 0.5, -150)
  47. CardSystem.Size = UDim2.new(0, 400, 0, 300)
  48.  
  49. -- 设置标题
  50. Title.Name = "Title"
  51. Title.Parent = CardSystem
  52. Title.BackgroundColor3 = Color3.fromRGB(44, 62, 80)
  53. Title.BorderSizePixel = 0
  54. Title.Position = UDim2.new(0.5, -100, 0, 20)
  55. Title.Size = UDim2.new(0, 200, 0, 50)
  56. Title.Font = Enum.Font.SourceSansBold
  57. Title.Text = "ROBLOX 卡密系统"
  58. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  59. Title.TextScaled = true
  60. Title.TextSize = 20.000
  61. Title.TextWrapped = true
  62.  
  63. -- 设置卡密标签
  64. CardLabel.Name = "CardLabel"
  65. CardLabel.Parent = CardSystem
  66. CardLabel.BackgroundColor3 = Color3.fromRGB(44, 62, 80)
  67. CardLabel.BorderSizePixel = 0
  68. CardLabel.Position = UDim2.new(0.232500002, -75, 0.430000007, 0)
  69. CardLabel.Size = UDim2.new(0, 144, 0, 36)
  70. CardLabel.Font = Enum.Font.SourceSansBold
  71. CardLabel.Text = "请输入卡密:"
  72. CardLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  73. CardLabel.TextScaled = true
  74. CardLabel.TextSize = 14.000
  75. CardLabel.TextWrapped = true
  76.  
  77. -- 设置卡密输入框
  78. CardEntry.Name = "CardEntry"
  79. CardEntry.Parent = CardSystem
  80. CardEntry.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  81. CardEntry.BorderSizePixel = 0
  82. CardEntry.Position = UDim2.new(0.654999971, -100, 0.449999988, 0)
  83. CardEntry.Size = UDim2.new(0, 200, 0, 30)
  84. CardEntry.ClearTextOnFocus = false
  85. CardEntry.Font = Enum.Font.SourceSansBold
  86. CardEntry.PlaceholderText = "请输入卡密"
  87. CardEntry.Text = "请输入卡密"
  88. CardEntry.TextColor3 = Color3.fromRGB(0, 0, 0)
  89. CardEntry.TextScaled = true
  90. CardEntry.TextSize = 14.000
  91. CardEntry.TextWrapped = true
  92. CardEntry.ClearTextOnFocus = true
  93.  
  94. -- 设置卡密输入框的圆角
  95. CardEntryUICorner.Name = "CardEntryUICorner"
  96. CardEntryUICorner.Parent = CardEntry
  97.  
  98. -- 设置确定按钮
  99. SubmitButton.Name = "SubmitButton"
  100. SubmitButton.Parent = CardSystem
  101. SubmitButton.BackgroundColor3 = Color3.fromRGB(46, 204, 113)
  102. SubmitButton.BorderSizePixel = 0
  103. SubmitButton.Position = UDim2.new(0.5, -75, 0.700000048, 0)
  104. SubmitButton.Size = UDim2.new(0, 150, 0, 30)
  105. SubmitButton.Font = Enum.Font.SourceSansBold
  106. SubmitButton.Text = "确定"
  107. SubmitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  108. SubmitButton.TextScaled = true
  109. SubmitButton.TextSize = 14.000
  110. SubmitButton.TextWrapped = true
  111.  
  112. -- 设置确定按钮的圆角
  113. SubmitButtonUICorner.CornerRadius = UDim.new(0, 15)
  114. SubmitButtonUICorner.Name = "SubmitButtonUICorner"
  115. SubmitButtonUICorner.Parent = SubmitButton
  116.  
  117. -- 设置图片
  118. CorrectIncorrectImageLabel.Name = "CorrectIncorrectImageLabel"
  119. CorrectIncorrectImageLabel.Parent = CardSystem
  120. CorrectIncorrectImageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  121. CorrectIncorrectImageLabel.BackgroundTransparency = 1.000
  122. CorrectIncorrectImageLabel.Position = UDim2.new(0.75, 0,0.8, 0)
  123. CorrectIncorrectImageLabel.Size = UDim2.new(0, 60, 0, 60)
  124.  
  125. -- 设置图片的圆角
  126. ImageLabelUICorner.CornerRadius = UDim.new(0, 15)
  127. ImageLabelUICorner.Name = "ImageLabelUICorner"
  128. ImageLabelUICorner.Parent = CorrectIncorrectImageLabel
  129.  
  130. -- 设置结果标签
  131. ResultLabel.Name = "ResultLabel"
  132. ResultLabel.Parent = CardSystem
  133. ResultLabel.BackgroundColor3 = Color3.fromRGB(44, 62, 80)
  134. ResultLabel.BorderSizePixel = 0
  135. ResultLabel.Position = UDim2.new(0.345, -100,0.86, 0)
  136. ResultLabel.Size = UDim2.new(0, 210,0, 32)
  137. ResultLabel.Font = Enum.Font.SourceSansBold
  138. ResultLabel.Text = ""
  139. ResultLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  140. ResultLabel.TextSize = 14.000
  141. ResultLabel.TextScaled = true
  142.  
  143. -- 设置框架的圆角
  144. CardSystemUICorner.CornerRadius = UDim.new(0, 50)
  145. CardSystemUICorner.Name = "CardSystemUICorner"
  146. CardSystemUICorner.Parent = CardSystem
  147.  
  148. -- 处理卡密的代码
  149. SubmitButton.MouseButton1Click:Connect(function()
  150. local cardCode = CardEntry.Text
  151. if cardCode == "Hello World" then-- ""内设置您的卡密
  152. ResultLabel.Text = "卡密验证成功!"
  153. CorrectIncorrectImageLabel.Image = "rbxassetid://12517387637"-- 设置卡密系统正确图片的ID
  154. wait(1)-- 关掉卡密系统的事件
  155. CardSystem:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  156. Title:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  157. CardLabel:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  158. CardEntry:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  159. SubmitButton:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  160. ResultLabel:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  161. CorrectIncorrectImageLabel:TweenSize(UDim2.new(0, 0, 0, 0),"In","Quad",0.2,true)
  162. wait(3)
  163. CardSystemScreenGui:Destroy()
  164. game.StarterGui:SetCore("SendNotification", {Title = "卡密正确", Text = "欢迎使用", Icon = "rbxassetid://12517387637", Duration = 4})-- 输入你的代码到这里
  165. else
  166. ResultLabel.Text = "卡密错误,请检查您的卡密是否正确"
  167. CorrectIncorrectImageLabel.Image = "rbxassetid://12517382532"-- 设置卡密系统错误图片的ID
  168. wait(2)-- 设置结果标签的内容为空
  169. ResultLabel.Text = ""
  170. CorrectIncorrectImageLabel.Image = ""
  171. end
  172. end)
  173. -- 灾难蛋制作
  174.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement