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

How do you make a part button? (See description)

How do you make a part button and when you click it a part will appear and when clicked again it will disappear? Any answers?

5 comments

0

Can you explain this a bit more? Are you looking to make an inventory? Or clicking a button to spawn a part within the workspace?

0

Uh like are you looking to click a gui button that toogles another gui?

0

im thinking the second one

0

he means when a part button is clicked, a "part" will appear and when it is clicked again, then the "part" will disappear

0

yeah your right

1 answer

✓ Accepted answer

You have to insert a clickdetector into that part. then you add this script:

local NewPart = game.Workspace["New Part"]

script.Parent.ClickDetector.MouseClick:Connect(function()
	if NewPart.Transparency == 0 and NewPart.CanCollide == true then 
		NewPart.Transparency = 1
		NewPart.CanCollide = false
	elseif NewPart.Transparency == 1 and NewPart.CanCollide == false then
		NewPart.Transparency = 0
		NewPart.CanCollide = true
	end
end)

You can change "New Part" to whatever you have named that part

PS: I have a question to: look at my account to see it

3 comments

0

Thank you for the answer! Gladly appreciate that!

0

That's nice to hear

0

Your Welcome!

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