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

Getting the previous part to the previous one?

Asked by
sebanuevo 123
4 years ago

Hello i am making a undo button for my game, where u can undo parts that you create, this all happens on the client, i already got a previous part but i want to get the previous part to the previous one

Code:


PartButton.MouseButton1Click:Connect(function() local Part = game.ReplicatedStorage.NewPart:Clone() Part.Parent = workspace.Parts -- Set the previous part PreviousPart = Part end) Undo.MouseButton1Click:Connect(function() if PreviousPart ~= nil then PreviousPart:Destroy() PreviousPart = nil end end)
1
You could save all the parts interacted with in a table as they are acted upon. This way, they'll be in an "ordered list" of sorts, and you can track them Gey4Jesus69 2705 — 4y
0
Im trying that, thank you! sebanuevo 123 — 4y
0
You can use the changed event and once change detected, you can list it. Gabe_elvin1226aclan 323 — 4y
0
How is it going to change? User#30567 0 — 4y

Answer this question