Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local ReplicatedStorage = game.ReplicatedStorage.Code
- local codes = player:WaitForChild("Codes")
- local codelist = {
- code1 = "suscribete",
- code2 = "xmaanzach"
- }
- -- Primer Código
- script.Parent.MouseButton1Click:Connect(function()
- if script.Parent.Parent.TextBox.Text == codelist.code1 then
- if not codes:FindFirstChild("Code1") then
- ReplicatedStorage:FireServer(500, "Code1")
- script.Parent.Text = "Código canjeado!"
- script.Parent.Parent.TextBox.Text = ""
- wait(2)
- script.Parent.Text = "Obtener"
- else
- script.Parent.Text = "Código ya canjeado!"
- wait(2)
- script.Parent.Text = "Obtener"
- end
- end
- -- Segundo Código
- if script.Parent.Parent.TextBox.Text == codelist.code2 then
- if not codes:FindFirstChild("Code2") then
- ReplicatedStorage:FireServer(300, "Code2")
- script.Parent.Parent.TextBox.Text = ""
- wait(2)
- script.Parent.Text = "Obtener"
- else
- script.Parent.Text = "Código ya canjeado!"
- wait(2)
- script.Parent.Text = "Obtener"
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment