reset234567890

Untitled

Jun 2nd, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. here a morph script that i found in freemodels which I just updated for my use
  2.  
  3. Where morphpart is wherever the part of the model you want to attach to the body and character[bodypart] is where you want to attach the model, just set a variable called "bodypart" to whatever part of the body you want it to attach.
  4.  
  5. just attach this to a key using UserInputService instead of keydown
  6. http://wiki.roblox.com/?title=API:Class/UserInputService
  7.  
  8. if you cant make sense of this, youre probably better off learning more scripting for now instead of tackling this.
  9.  
  10. MORPH SCRIPT =========================================================================
  11.  
  12. local morphpart = game.ServerStorage["Equipped Items"][category][item][slot]:Clone()
  13. morphpart.Parent = character
  14. local C = morphpart:GetChildren()
  15. for i=1, #C do
  16. if C[i].className == "Part" or "Union" then
  17. local W = Instance.new("Weld")
  18. W.Part0 = morphpart.Middle
  19. W.Part1 = C[i]
  20. local CJ = CFrame.new(morphpart.Middle.Position)
  21. local C0 = morphpart.Middle.CFrame:inverse()*CJ
  22. local C1 = C[i].CFrame:inverse()*CJ
  23. W.C0 = C0
  24. W.C1 = C1
  25. W.Parent = morphpart.Middle
  26. end
  27. local Y = Instance.new("Weld")
  28. Y.Part0 = character[bodypart]
  29. Y.Part1 = morphpart.Middle
  30. Y.C0 = CFrame.new(0, 0, 0)
  31. Y.Parent = morphpart.Middle
  32. end
  33.  
  34. local h = morphpart:GetChildren()
  35. for i = 1, # h do
  36. h[i].Anchored = false
  37. h[i].CanCollide = false
  38. end
Advertisement
Add Comment
Please, Sign In to add comment