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

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

Asked by
CedCed6 32
4 years ago

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?

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? Yozoh 146 — 4y
0
Uh like are you looking to click a gui button that toogles another gui? Yozoh 146 — 4y
0
im thinking the second one CedCed6 32 — 4y
0
he means when a part button is clicked, a "part" will appear and when it is clicked again, then the "part" will disappear AnasBahauddin1978 715 — 4y
0
yeah your right CedCed6 32 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
Thank you for the answer! Gladly appreciate that! CedCed6 32 — 4y
0
That's nice to hear FireDreamGames 17 — 4y
0
Your Welcome! CedCed6 32 — 4y
Ad

Answer this question