Hi, I have created a script that clones a model in my workspace called keyboard, and welds it to the players characters UpperTorso. This works completely fine on the normal “1.0” Roblox character package, however…
When I wear a Robloxian 2.0 package, the keyboard clone model does not parent nor weld to the players characters UpperTorso. Console still prints the instance, as if it exists, but the keyboard clone doesn’t show up in the explorer tab, and there are no errors shown in console either. I want my script to be able to apply the clone keyboard model to any kind of torso, no matter what package the player is wearing, but I have no idea what is wrong or why it isn’t working on 2.0 models. How can I do this? thank you!
gif of the problem
Script -
--services
local ServerStorage = game:GetService("ServerStorage")
--keyboard
local original = ServerStorage.KeyboardOriginal
local function onCharacterAdded(character)
print("character")
local head = character:WaitForChild("Head")
local upperTorso = character:WaitForChild("UpperTorso")
--create keyboard for player and attach to back
local keyboard = original:Clone()
keyboard.Name = "Keyboard"
keyboard.Parent = upperTorso
keyboard.PrimaryPart = keyboard.Backboard
keyboard.PrimaryPart.CFrame = upperTorso.CFrame * CFrame.new(0,0,0.55) * CFrame.Angles(math.rad(90),math.rad(225),0)
--create weld for keyboard
local keyboardWeld = Instance.new("Weld", upperTorso)
keyboardWeld.Part0 = upperTorso
keyboardWeld.Part1 = keyboard.Backboard
keyboardWeld.C0 = upperTorso.CFrame:Inverse()
keyboardWeld.C1 = keyboard.Backboard.CFrame:Inverse()
print(tostring(keyboard.Parent))
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(onCharacterAdded)
end)