Advertisement
lllkkklkk

the redman

Jul 24th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. -- Function to change the color of the character's body parts, remove pants, destroy accessories, update the shirt template, and set animations
  2. local function modifyCharacter(character, color, newShirtTemplate, idleAnimationId, walkRunAnimationId)
  3. -- Remove pants
  4. local pants = character:FindFirstChildOfClass("Pants")
  5. if pants then
  6. pants:Destroy()
  7. end
  8.  
  9. -- Destroy all accessories
  10. for _, accessory in pairs(character:GetChildren()) do
  11. if accessory:IsA("Accessory") then
  12. accessory:Destroy()
  13. end
  14. end
  15.  
  16. -- Change the color of the body parts
  17. for _, part in pairs(character:GetChildren()) do
  18. if part:IsA("BasePart") then
  19. part.Color = color
  20. end
  21. end
  22.  
  23. -- Update the existing shirt template
  24. local shirt = character:FindFirstChildOfClass("Shirt")
  25. if shirt then
  26. shirt.ShirtTemplate = newShirtTemplate
  27. end
  28.  
  29. -- Set the animations
  30. local humanoid = character:FindFirstChildOfClass("Humanoid")
  31. if humanoid then
  32. -- Idle Animation
  33. local idleAnimation = Instance.new("Animation")
  34. idleAnimation.AnimationId = "rbxassetid://" .. idleAnimationId
  35. local idleAnimationTrack = humanoid:LoadAnimation(idleAnimation)
  36. idleAnimationTrack:Play()
  37.  
  38. -- Walk/Run Animation
  39. local walkRunAnimation = Instance.new("Animation")
  40. walkRunAnimation.AnimationId = "rbxassetid://" .. walkRunAnimationId
  41. local walkRunAnimationTrack = humanoid:LoadAnimation(walkRunAnimation)
  42. humanoid.WalkSpeed = 16 -- Set a default walk speed if needed
  43. humanoid.Running:Connect(function(speed)
  44. if speed > 0 then
  45. walkRunAnimationTrack:Play()
  46. else
  47. walkRunAnimationTrack:Stop()
  48. end
  49. end)
  50. end
  51. end
  52.  
  53. -- Get the player and their character
  54. local player = game.Players.LocalPlayer
  55. local character = player.Character or player.CharacterAdded:Wait()
  56.  
  57. -- Set the desired color, new shirt template, and animation IDs
  58. local redColor = Color3.fromRGB(255, 0, 0)
  59. local newShirtTemplate = "rbxassetid://15724447914" -- Use the asset ID directly
  60. local idleAnimationId = "18631254999"
  61. local walkRunAnimationId = "18631265977"
  62.  
  63. -- Modify the character
  64. modifyCharacter(character, redColor, newShirtTemplate, idleAnimationId, walkRunAnimationId)
  65.  
  66. -- Listen for character respawn to apply the changes again
  67. player.CharacterAdded:Connect(function(newCharacter)
  68. modifyCharacter(newCharacter, redColor, newShirtTemplate, idleAnimationId, walkRunAnimationId)
  69. end)
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement