Hi, I have tried many attempts to make an twitter code gui. I did make it work, but I wanted to add another feature which is to check if the player has already redeemed the code. I tried countless times and it never worked, I would like someone to explain to me how to do it properly.
Here is the code:
local ifowned = false
script.Parent.MouseButton1Click:connect(function() if script.Parent.Parent.TextBox.Text == "code" then script.Parent.Parent.TextBox.Text = "reedemed!" wait(0.5) script.Parent.Parent.TextBox.Text = "enter code here" ifowned = true else script.Parent.Parent.TextBox.Text = "Invalid code" wait(0.5) script.Parent.Parent.TextBox.Text = "enter code here" if ifowned == true and script.Parent.Parent.TextBox.Text == "code" then script.Parent.Parent.TextBox.Text = "already reedemed" wait(0.5) script.Parent.Parent.TextBox.Text = "enter code here" end end end)
don't mind me if I make spelling mistakes in the script. Sorry I don't know how to use the code block, because I don't know how to use it.
local ifowned = false local tbox = script.Parent.Parent.TextBox script.Parent.MouseButton1Click:connect(function() if tbox.Text == "code" then print("reedemed!") ifowned = true else print("invalid code") if ifowned == true and tbox.Text == "code" then print("you already reedemed code") end end end)
here is my code block. I checked everything in the output and works but the redeemed thing is not working. Don't mind the spelling errors in the script.