Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ui = script.Parent
- local frame = ui.Frame
- local players = game:GetService("Players")
- local player = players.LocalPlayer
- local rep = game:GetService("ReplicatedStorage")
- local remote = rep:WaitForChild("RedeemCode")
- local Redeeming = false
- frame.Redeem.MouseButton1Click:Connect(function()
- if Redeeming == false then
- Redeeming = true
- task.delay(1.5,function() -- cooldown to not spam codes
- Redeeming = false
- end)
- local boolean,message = remote:InvokeServer(frame.Box.Text)
- if boolean ~= nil and message ~= nil then
- frame.Box.Text = message
- if boolean == true then
- frame.Redeem.TextColor3 = Color3.fromRGB(0, 255, 0) -- you can remove this, its just a code indicator
- else
- frame.Redeem.TextColor3 = Color3.fromRGB(255, 0, 0) -- you can remove this, its just a code indicator
- end
- task.delay(.1,function()
- frame.Redeem.TextColor3 = Color3.fromRGB(255, 255, 255) -- you can remove this, its just a code indicator
- end)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment