Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make this sccript so that once they redeemed the code they cannot do it again?

Asked by 8 years ago
local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(game.Players.LocalPlayer.Name)
script.Parent.MouseButton1Click:connect(function()
    if script.Parent.Parent.Input.Text == 'PROMOCODE' then
        cashmoney.Value = cashmoney.Value + 10000
        script.Parent.Parent.Input.Text = 'Code Redeemed!'
        wait(2)
        script.Parent.Parent.Input.Text = 'Enter Code Here'
    else
        script.Parent.Parent.Input.Text = 'Code Invalid'
        wait(2)
        script.Parent.Parent.Input.Text = 'Enter Code Here'
    end

end)
0
I would suggest using a datastore, to make sure it's already entered yoshi8080 445 — 8y
0
how would i do that? sentry3 6 — 8y
0
I would look on how to do that on youtube or the wiki yoshi8080 445 — 8y
0
I triedall they use is leaderstats sentry3 6 — 8y
View all comments (2 more)
0
Try inserting a value into each player that joins such as Code1 and just set it's value to 1 if it's been used and save that to the datastore. Cuvette 246 — 8y
0
tysm sentry3 6 — 8y

Answer this question