GreenfireOffical

Untitled

Jul 4th, 2025
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | Source Code | 0 0
  1. Put This Server Script in the Model you gonna transfrom:
  2.  
  3.  
  4. local Players = game:GetService("Players")
  5.  
  6. local model = script.Parent
  7. local humanoid = model:WaitForChild("Humanoid")
  8.  
  9. local function getPlayerFromCharacter(character)
  10. for _, player in pairs(Players:GetPlayers()) do
  11. if player.Character == character then
  12. return player
  13. end
  14. end
  15. return nil
  16. end
  17.  
  18. local function applyPlayerAvatar()
  19. local player = getPlayerFromCharacter(model)
  20. if not player then
  21. warn("Player bulunamadı!")
  22. return
  23. end
  24.  
  25. local success, avatarModel = pcall(function()
  26. return Players:GetCharacterAppearanceAsync(player.UserId)
  27. end)
  28.  
  29. if not success or not avatarModel then
  30. warn("Avatar modeli alınamadı!")
  31. return
  32. end
  33.  
  34. for _, child in pairs(model:GetChildren()) do
  35. if child:IsA("Shirt") or child:IsA("Pants") or child:IsA("BodyColors") or child:IsA("Accessory") then
  36. child:Destroy()
  37. end
  38. end
  39.  
  40. for _, item in ipairs(avatarModel:GetChildren()) do
  41. if item:IsA("Shirt") or item:IsA("Pants") or item:IsA("BodyColors") then
  42. item:Clone().Parent = model
  43. end
  44. end
  45.  
  46. for _, acc in ipairs(avatarModel:GetChildren()) do
  47. if acc:IsA("Accessory") then
  48. local clonedAcc = acc:Clone()
  49. clonedAcc.Parent = model
  50. end
  51. end
  52. end
  53.  
  54. humanoid.Running:Connect(function(speed)
  55. if speed > 0 then
  56. applyPlayerAvatar()
  57. end
  58. end)
  59.  
  60. applyPlayerAvatar()
  61.  
Advertisement
Add Comment
Please, Sign In to add comment