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
Tools:https://developer.roblox.com/en-us/api-reference/class/Tool
I suggest learning about tools first because some of the scripts in your code doesn't make sense and you are supposed to use 2 equals in a for loop
And when making gear you have to clone it to the backpack so it gives everyone who redeems the code.