Disable "Reset" button temporarily when part is clicked

I’m trying to make a part that will disable the “reset” button when it is clicked, and then enable it again after 27 seconds. I also only need it to only be clickable once, and then never again. The part is labeled “KEY” and is a child of Workspace.

Here is a LocalScript which is a child of StarterGui:

local StarterGui = game:GetService('StarterGui')
wait()
StarterGui:SetCore("ResetButtonCallback",false)

The script above will currently disable the reset button forever once a player joins.

2 Likes

You mean you wanna turn it on again? StarterGui:SetCore("ResetButtonCallback",true)

2 Likes

You can create a BindableEvent to connect to when the player clicks the Reset button.

local sgui = game:GetService("StarterGui")
local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:Connect(function()
	sgui:SetCore("ResetButtonCallback", false) -- disable the button
	task.wait(27)
	sgui:SetCore("ResetButtonCallback", true) -- enable the button
end)

sgui:SetCore("ResetButtonCallback", resetBindable)
1 Like