player.CharacterAdded:Connect(function(character: Model)
local OC = Omnitrix:Clone()
local Arm:Part = character:WaitForChild("LeftLowerArm")
OC.PrimaryPart.ArmWeld.Part1 = Arm
OC.PrimaryPart.CFrame = Arm.CFrame
print(os.clock())
OC.Parent = Arm
OC.PrimaryPart.Destroying:Once(function()print(os.clock()) end)
end)
The parts in the model are welded (but they do not move even though the part that they are welded has its CFrame changed which is strange) and I tested to see if the parts in the model are deleted because they are too low which is not the case. For a reason I don’t know, the model itself is being deleted half of a millisecond after it enters workspace.
I just unanchored everything in the model and it seemed to work fine. The rest of the model was just floating off in space but wasn’t getting voided because it was anchored.
Here’s what I did and it worked for me, the main solution was waiting for the character appearance to fully load and then add the
omnitrix
onto the character.
PlayersService.PlayerAdded:Connect(function(player: Player)
-- Set up attributes when player joins the game
player:SetAttribute("Blocking",false)
player:SetAttribute("Stunned",false)
player:SetAttribute("Damage",10)
player:SetAttribute("Stamina", MaxStamina)
player:SetAttribute("MaxStamina", MaxStamina)
player:SetAttribute("Sprinting", false)
StaminaSystem(player)
player.CharacterAdded:Connect(function(character: Model)
player.CharacterAppearanceLoaded:Wait()
local OC = Omnitrix:Clone()
local Arm:Part = character:WaitForChild("LeftLowerArm")
OC.PrimaryPart.ArmWeld.Part1 = Arm
OC.PrimaryPart.CFrame = Arm.CFrame
print(os.clock())
OC.Parent = Arm
OC.PrimaryPart.Destroying:Once(function()print(os.clock()) end)
for _, obj in OC:GetDescendants() do
if not obj:IsA('BasePart') then continue end
obj.Anchored = false
end
end)
end)