i'm trying to make a script that if you redeem the code you get a tool if you redeem again the text says "Already Redeemed!" if someone in the comments can send me a code of how to make that please do because i'm trying to make a game called "Days before nights" and trying to make a code to get a flash light
code:
if script.Parent.Parent.CodeBar.Text == "BETATESTER" then script.Parent.MouseButton1Click:Connect(function() script.Parent.Text = "Succesfully Redeemed!" wait(2) script.Parent.Text = "Redeem" then player.Backpack == "Flashlight" end end

1 comment
Try learning actual scripting instead of using youtube; it's better to learn, so you can fix the bugs. Probably use DataStores to save the value representing that they have redeemed the code.