Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local Codes = script.Parent:WaitForChild("holder"):WaitForChild("Codes"):GetChildren()
- local CodeText = script.Parent.holder.__Codes.__EnterCode:WaitForChild("EnterCode")
- local Cash = player:WaitForChild("leaderstats"):WaitForChild("Coins")
- local Gems = player:WaitForChild("leaderstats"):WaitForChild("Gems")
- script.Parent.holder.__Codes.__Confirm:WaitForChild("Confirm").MouseButton1Click:connect(function()
- for i, v in pairs(Codes) do
- if CodeText.Text == v.Name then
- if v.Redeemed.Value == false then
- Cash.Value = Cash.Value + v.CashToGive.Value
- Gems.Value = Gems.Value + v.GemsToGive.Value
- game.Workspace.Sounds.MoneySound:Play()
- local Trans = script.Parent.holder.__Codes.Success
- Trans.TextTransparency = 0
- Trans.TextStrokeTransparency = 0
- v.Redeemed.Value = true
- wait(2.5)
- for i = 0, 1, 0.1 do
- wait(0)
- Trans.TextTransparency = i
- Trans.TextStrokeTransparency = i
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement