Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acc9482
commit 1f37102
Showing
171 changed files
with
10,107 additions
and
1,611 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
BuiltInPlugins/AvatarImporter/configurer/CharacterTester.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
local CharacterTester = {} | ||
|
||
local StarterPlayer = game:GetService("StarterPlayer") | ||
|
||
local function removeExistingStarterCharacter() | ||
while true do | ||
local starterCharacter = StarterPlayer:FindFirstChild("StarterCharacter") | ||
if starterCharacter then | ||
starterCharacter:Destroy() | ||
else | ||
break | ||
end | ||
end | ||
end | ||
|
||
local function addAccessoriesFromWorkspace(character) | ||
-- Clone accessories into character | ||
for _, accessory in pairs(game.Workspace:GetChildren()) do | ||
if accessory:IsA("Accessory") then | ||
local newAccessory = accessory:Clone() | ||
newAccessory.Parent = character | ||
end | ||
end | ||
end | ||
|
||
function CharacterTester.SetupCharacterForTesting(characterToTest) | ||
if not characterToTest then | ||
return | ||
end | ||
|
||
removeExistingStarterCharacter() | ||
|
||
local newCharacter = characterToTest:Clone() | ||
addAccessoriesFromWorkspace(newCharacter) | ||
|
||
newCharacter.Name = "StarterCharacter" | ||
newCharacter.Parent = StarterPlayer | ||
end | ||
|
||
return CharacterTester |
Oops, something went wrong.