null
nil
-
[RBX1]
0
false
true
0
0
0
1
0
0
0
1
0
0
0
1
Workspace
[null]
false
-
[null]
0
0.105249323
2.93674922
5.02452087
0.999780655
-0.0105661219
0.0180816781
-9.31322464e-10
0.863394618
0.504529178
-0.0209425408
-0.504418492
0.863205314
70
0
0
0
1
0
0
0
1
0
0
0
1
Camera
-
true
-0.5
0.5
0
0
-0.5
0.5
4
0
194
0
0
0
1
0
0
0
1
0
0
0
1
true
0.300000012
0.5
-0.5
0.5
0
0
-0.5
0.5
0
0
true
256
Terrain
0
-0.5
0.5
0
0
0
0
0
-0.5
0.5
3
0
0
0
0
0
2044
252
2044
-
LogService
-
true
Players
-
PointsService
-
StarterPack
-
StarterGui
true
-
0
10
1
Soundscape
1
-
CollectionService
-
PhysicsService
-
BadgeService
-
Geometry
-
RenderHooksService
-
SocialService
-
GamePassService
-
1000
Debris
-
Instance
-
Instance
-
CookiesService
-
Teleport Service
-
Instance
-
Instance
-
ContextActionService
-
Instance
-
AssetService
-
Selection
-
false
ServerScriptService
-
ServerStorage
-
ReplicatedStorage
-
ChangeHistoryService
-
4286611584
1
4278190080
4278190080
4290822336
100000
0
41.7332993
false
Lighting
4286611584
true
4289967032
14:00:00
-
false
true
true
true
TestService
0
10
-
false
Script
local function modifyName(part, name)
part.Name = name
game:GetService("ChangeHistoryService"):SetWaypoint("PropName")
end
local function createPart(name)
print("Creating part: "..name);
-- create part and set workspace as parent
local part = Instance.new("Part")
part.Parent = game.Workspace
game:GetService("ChangeHistoryService"):SetWaypoint("Create")
-- modify name and create another way point for property
modifyName(part, name)
end
local function deletePart(name)
print("Deleting part: "..name);
local part = game.Workspace:FindFirstChild(name)
part.Parent = NULL
game:GetService("ChangeHistoryService"):SetWaypoint("Delete")
end
local function executeVerb(verbName)
script.Parent:DoCommand(verbName)
end
local function checkCondition(stepName, expectedChildren)
local currentChldCount = #Workspace:GetChildren();
print("After "..stepName.." - child count: "..currentChldCount.." , expected: "..expectedChildren)
RBX_CHECK_EQUAL(expectedChildren, currentChldCount)
end
local startCount = #Workspace:GetChildren()
local numChildren = 3
game:GetService("ChangeHistoryService"):SetEnabled(1)
-- Create parts and modify name property (2 waypoints created per part)
for count = 1, numChildren, 1 do
createPart("Part"..count)
checkCondition("Part"..count.." Create", startCount+count)
end
-- Undo parts creation: 1 undo for creation and 1 for property change
for count = 1, numChildren, 1 do
game:GetService("ChangeHistoryService"):Undo()
game:GetService("ChangeHistoryService"):Undo()
checkCondition("Undo Part"..count.." Create", startCount+numChildren-count)
end
-- Redo parts creation
for count = 1, numChildren, 1 do
game:GetService("ChangeHistoryService"):Redo()
game:GetService("ChangeHistoryService"):Redo()
checkCondition("Redo Part"..count.." Create", startCount+count)
end
-- Delete parts
for count = 1, numChildren, 1 do
deletePart("Part"..count)
checkCondition("Part"..count.." Delete", startCount+numChildren-count)
end
-- Undo delete: parts should be added back
for count = 1, numChildren, 1 do
game:GetService("ChangeHistoryService"):Undo()
checkCondition("Undo Part"..count.." Delete", startCount+count)
end
-- Redo delete: parts should again be removed
for count = 1, numChildren, 1 do
game:GetService("ChangeHistoryService"):Redo()
checkCondition("Redo Part"..count.." Delete", startCount+numChildren-count)
end
-
Teams