Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- script.Parent.MouseButton1Click:connect(function()
- local RedeemedCode = script.Parent.Parent.CodeType.Text
- local TextboxCode = script.Parent.Parent.CodeType
- if plr and RedeemedCode and plr:FindFirstChild("Codes") and plr.Codes:FindFirstChild(RedeemedCode) and not plr.Codes[RedeemedCode].Value then
- game.ReplicatedStorage.RedeemCode:FireServer(RedeemedCode)
- TextboxCode.Text = "Successfully redemmed"
- elseif plr and RedeemedCode and plr:FindFirstChild("Codes") and plr.Codes:FindFirstChild(RedeemedCode) and plr.Codes[RedeemedCode].Value then
- TextboxCode.Text = "You have already Redeemed."
- task.wait(0.5)
- TextboxCode.Text = "Enter Your Code"
- else
- TextboxCode.Text = "Error or invalid"
- task.wait(0.5)
- TextboxCode.Text = "Enter Your Code"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement