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

Help with making a button clickable only ONE time even if you server hop?

Asked by 5 years ago

I'm wondering how I would go about this to get it how I want it. I don't really have a code sample for you to fix. I am more of asking for information or sources that would lead to helping me complete this.

Basically, I'm looking to make sort of like an achievement GUI. Where you achieve achievements by doing certain things, and once you get a certain achievement, a button shows up allowing you to claim a reward for that achievement. I'm wanting this claim button to only be available as a ONE time use.

I have sort of an example, well, this is the extent of my research. I couldn't find anything closer than this.

local click
click = script.Parent.MouseButton1Click:Connect(function()
    click:Disconnect()
  print("Button Clicked")
end)

This allows for the button to only be clicked once, so it's sort of what I want. HOWEVER, once you rejoin the server, the button works again. I want it to where it only works ONE time no matter how many times you rejoin.

The second thing I have in mind is saving a BoolValue or so to a DataStore and set it to true whenever the button is pressed which then saves in the DataStore to never change back to False. I could probably make this work, but it seems like it's a bit extra. Is this the way I'm gonna have to go or is there an easier way?

0
Yes, you will need to hook this up to DataStore. xPolarium 1388 — 5y
0
i concur LordOfWatermelons 27 — 5y
0
I see, thank you to you 2 for confirming this. TheOddyssey 9 — 5y

Answer this question