Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I set the frame Visible = false when the button has been clicked ?

script.Parent.Parent.Parent.Parent.Archivable should be set = false after the button has been clicked. after wait (10) script.Parent.Parent.Parent.Parent.Archivable should be set to true again.

local p = game.Players.LocalPlayer
local debounce = true

script.Parent.MouseClick:Connect(function(p)
	local Backpack = p.Backpack
	local Tool = game.ReplicatedStorage.Equipment.BottleDrinks.Cola1
	local Clone = Tool:Clone()
	Clone.Parent = Backpack
	script.Parent.Parent.Parent.Parent.Archivable = false   	--)
	wait(10)													--) My  try but it doesnt work
	script.Parent.Parent.Parent.Parent.Archivable = true		--)
end)

2 comments

0

You sure you don’t want to use Visible instead of Archivable considering your question is asking to make a frame no longer Visible?

0

Archivable determines if an Instance can be cloned. Visible determines if a GUI object can be seen. I don't understand why you're using Archivable.

1 answer

Assuming script.Parent.Parent.Parent.Parent is a Frame, just change Archivable to Visible


local p = game.Players.LocalPlayer
local debounce = true

script.Parent.MouseClick:Connect(function(p)
    local Backpack = p.Backpack
    local Tool = game.ReplicatedStorage.Equipment.BottleDrinks.Cola1
    local Clone = Tool:Clone()
    Clone.Parent = Backpack
    script.Parent.Parent.Parent.Parent.Visible = false
    wait(10)                                                   
    script.Parent.Parent.Parent.Parent.Visible = true
end)

4 comments

0

is it possible to only dissable the script for 10sec ?

0

Yeah I’m pretty sure it is

0

can you show me how ?

0

If you’re talking about the script above, you can make another script and make it so when the button is clicked it disables the script for 10 seconds.

This discussion is preserved as it was. New answers, comments, and votes are closed.