RoScripter

Twitter Codes Client

Sep 27th, 2020 (edited)
5,313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local RedeemFrame = script.Parent.RedeemFrame
  2. local CodeBox = RedeemFrame.CodeBox
  3. local RedeemButton = RedeemFrame.RedeemButton
  4. local ToggleButton = script.Parent.ToggleButton
  5.  
  6. ToggleButton.MouseButton1Click:Connect(function()
  7.     RedeemFrame.Visible = not RedeemFrame.Visible
  8. end)
  9.  
  10. RedeemButton.MouseButton1Click:Connect(function()
  11.     local Code = CodeBox.Text
  12.     local Redeemed = game.ReplicatedStorage.RedeemCode:InvokeServer(Code)
  13.    
  14.     if Redeemed == true then
  15.         CodeBox.Text = ""
  16.         CodeBox.PlaceholderText = "Redeemed Code!"
  17.         wait(1)
  18.         CodeBox.PlaceholderText = "Twitter Code Here"
  19.     else
  20.         CodeBox.Text = ""
  21.         CodeBox.PlaceholderText = "Invalid Code"
  22.         wait(1)
  23.         CodeBox.PlaceholderText = "Twitter Code Here"
  24.     end
  25. end)
Add Comment
Please, Sign In to add comment