xmaanzach

Redeem Button Script

Jan 11th, 2019
5,914
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local ReplicatedStorage = game.ReplicatedStorage.Code
  3. local codes = player:WaitForChild("Codes")
  4.  
  5. local codelist = {
  6.  
  7. code1 = "suscribete",
  8. code2 = "xmaanzach"
  9.  
  10. }
  11. -- Primer Código
  12. script.Parent.MouseButton1Click:Connect(function()
  13. if script.Parent.Parent.TextBox.Text == codelist.code1 then
  14. if not codes:FindFirstChild("Code1") then
  15. ReplicatedStorage:FireServer(500, "Code1")
  16. script.Parent.Text = "Código canjeado!"
  17. script.Parent.Parent.TextBox.Text = ""
  18. wait(2)
  19. script.Parent.Text = "Obtener"
  20. else
  21. script.Parent.Text = "Código ya canjeado!"
  22. wait(2)
  23. script.Parent.Text = "Obtener"
  24. end
  25. end
  26. -- Segundo Código
  27. if script.Parent.Parent.TextBox.Text == codelist.code2 then
  28. if not codes:FindFirstChild("Code2") then
  29. ReplicatedStorage:FireServer(300, "Code2")
  30. script.Parent.Parent.TextBox.Text = ""
  31. wait(2)
  32. script.Parent.Text = "Obtener"
  33. else
  34. script.Parent.Text = "Código ya canjeado!"
  35. wait(2)
  36. script.Parent.Text = "Obtener"
  37. end
  38. end
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment