SetWaypoint (Function)

From Goodblox Wiki
Revision as of 08:55, 24 September 2021 by Xyrafrost (talk | contribs) (created the page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Locked: This item is locked. Attempting to use it will cause an error.


Function
Syntax SetWaypoint( String name )
Returns n/a
Description: Sets a new waypoint which can be used as an undo or redo point.
In Object: ChangeHistoryService


Example

In order for the waypoints to work correctly, you need to set one both before AND after you perform the action that should be able to be undone.

local changeHistoryService = game:GetService("ChangeHistoryService")
local part = workspace.Part

changeHistoryService:SetWaypoint("Setting part material to wood")
part.Material = Enum.Material.Wood
changeHistoryService:SetWaypoint("Set part material to wood")