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.

5 comments
Please set this in a real script by clicking the Lua icon.'
It is hard to read please put it in Code block :D
You can't do it all in a local script, you must utilize a server-script to save that the player has redeemed the code.
Have you tried opening output to check if something was working?
I posted the code block