Advertisement
Dfgjfj

LocalScript TextButton

Dec 22nd, 2024
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. local plr = game.Players.LocalPlayer
  3.  
  4. script.Parent.MouseButton1Click:connect(function()
  5. local RedeemedCode = script.Parent.Parent.CodeType.Text
  6. local TextboxCode = script.Parent.Parent.CodeType
  7. if plr and RedeemedCode and plr:FindFirstChild("Codes") and plr.Codes:FindFirstChild(RedeemedCode) and not plr.Codes[RedeemedCode].Value then
  8. game.ReplicatedStorage.RedeemCode:FireServer(RedeemedCode)
  9. TextboxCode.Text = "Successfully redemmed"
  10. elseif plr and RedeemedCode and plr:FindFirstChild("Codes") and plr.Codes:FindFirstChild(RedeemedCode) and plr.Codes[RedeemedCode].Value then
  11. TextboxCode.Text = "You have already Redeemed."
  12. task.wait(0.5)
  13. TextboxCode.Text = "Enter Your Code"
  14. else
  15. TextboxCode.Text = "Error or invalid"
  16. task.wait(0.5)
  17. TextboxCode.Text = "Enter Your Code"
  18. end
  19. end)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement