Advertisement
LolPenguinOwO

load valkyrie

Dec 15th, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. getgenv().Time = 1 -- Adjust the time waited before adding the items
  2.  
  3. getgenv().Head = {
  4. 1365767
  5. -- Add more head accessory IDs
  6. }
  7. --//------------------------------------------------------------------------------------------\\--
  8.  
  9. local function weldParts(part0, part1, c0, c1)
  10. local weld = Instance.new("Weld")
  11. weld.Part0 = part0
  12. weld.Part1 = part1
  13. weld.C0 = c0
  14. weld.C1 = c1
  15. weld.Parent = part0
  16. return weld
  17. end
  18.  
  19. local function findAttachment(rootPart, name)
  20. for _, descendant in pairs(rootPart:GetDescendants()) do
  21. if descendant:IsA("Attachment") and descendant.Name == name then
  22. return descendant
  23. end
  24. end
  25. end
  26.  
  27. local function addAccessoryToCharacter(accessoryId, parentPart)
  28. local accessory = game:GetObjects("rbxassetid://" .. tostring(accessoryId))[1]
  29. local character = game.Players.LocalPlayer.Character
  30.  
  31. accessory.Parent = game.Workspace
  32.  
  33. local handle = accessory:FindFirstChild("Handle")
  34. if handle then
  35. local attachment = handle:FindFirstChildOfClass("Attachment")
  36. if attachment then
  37. local parentAttachment = findAttachment(parentPart, attachment.Name)
  38. if parentAttachment then
  39. weldParts(parentPart, handle, parentAttachment.CFrame, attachment.CFrame)
  40. end
  41. else
  42. local parent = character:FindFirstChild(parentPart.Name)
  43. if parent then
  44. local attachmentPoint = accessory.AttachmentPoint
  45. weldParts(parent, handle, CFrame.new(0, 0.5, 0), attachmentPoint.CFrame)
  46. end
  47. end
  48. end
  49.  
  50. accessory.Parent = game.Players.LocalPlayer.Character
  51. end
  52.  
  53. local function onCharacterAdded(character)
  54. wait(getgenv().Time) -- Wait for the character to fully load
  55.  
  56. for _, accessoryId in ipairs(getgenv().Head) do
  57. addAccessoryToCharacter(accessoryId, character.Head)
  58. end
  59.  
  60. for _, accessoryId in ipairs(getgenv().Torso) do
  61. addAccessoryToCharacter(accessoryId, character:FindFirstChild("UpperTorso") or character:FindFirstChild("Torso"))
  62. end
  63. end
  64.  
  65. game.Players.LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
  66.  
  67. if game.Players.LocalPlayer.Character then
  68. onCharacterAdded(game.Players.LocalPlayer.Character)
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement