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

How do I enable/disable parts with a text button GUI?

I want to make a button that'll reduce lag in a game I'm working on by removing unnecessary parts, emitters, etc. So, I started by testing with a single part without the GUI or anything with this line of code, game.Workspace.test.Archivable = true when I ran the game nothing had happened so I tried the inverse, archiving the part within studio and using this line of code, game.Workspace.test.Archivable = false and the part had stayed archived and the script rendered useless. I then tried using the GUI hoping there'd be a difference but it didn't do anything. I inserted the following script inside of the TextButton. local test = game.Workspace.test local toggle = false script.Parent.MouseButton1Click:Connect(function() if toggle == false then test.Archivable = true toggle = true else test.Archivable = false toggle = false end end) Once again, when playing the game it didn't have an effect on the brick, so I tried doing the inverse, which obviously did nothing. Is there another way I could try to enable and disabe the part as archiving clearly isn't working.

1 answer

✓ Accepted answer

Archivable won't do anything.. You either have to store the items in replicatedstorage(or elsewhere) or remove them which is what the script below does to a baseplate

script.Parent.MouseButton1Click:Connect(function()
	game.Workspace.Baseplate:Destroy()
end)

5 comments

1

I'm an actual idiot, thank you.

0

Np I would appreciate if you would upvote/accept the answer would mean a lot.

1

I can't upvote considering I don't have enough reputation, but how would I go about accepting the answer?

0

Should be a button right below the answer

0

It did not show that before, strange

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