Advertisement
darkblooood

aaaaa

Jan 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. local rankModule = require(script.Parent.Modules.GetRank)
  2.  
  3. function updateAvatar(material, color, char)
  4.  
  5. wait(0.1)
  6.  
  7. for _, child in pairs(char:GetChildren()) do
  8.  
  9. if child:IsA("BasePart") then
  10. child.Material = material
  11. child.Color = Color3.fromRGB(tonumber(color[1]), tonumber(color[2]), tonumber(color[3]))
  12. end
  13.  
  14. end
  15.  
  16. end
  17.  
  18. local value = nil
  19. local char1 = nil
  20.  
  21. game.Players.PlayerAdded:Connect(function(plr)
  22.  
  23.  
  24.  
  25. plr.CharacterAdded:Connect(function(char)
  26.  
  27. char1 = char
  28.  
  29. wait(0.25)
  30.  
  31. for _, child in pairs(char:GetChildren()) do
  32.  
  33. if child:IsA("Accessory") then
  34.  
  35. child:Destroy()
  36.  
  37. end
  38.  
  39. if child:IsA("Shirt") then
  40.  
  41. child:Destroy()
  42.  
  43. end
  44.  
  45. if child:IsA("Pants") then
  46.  
  47. child:Destroy()
  48.  
  49. end
  50.  
  51. if child:IsA("ShirtGraphic") then
  52.  
  53. child:Destroy()
  54.  
  55. end
  56.  
  57.  
  58.  
  59. end
  60.  
  61. value = rankModule.GetPlayerRank(plr.Name)
  62.  
  63. wait(0.1)
  64.  
  65. updateAvatar(value[1], value[2], char)
  66.  
  67. end)
  68.  
  69.  
  70.  
  71. plr:WaitForChild("leaderstats").RAP.Changed:Connect(function()
  72. value = rankModule.GetPlayerRank(plr.Name)
  73. updateAvatar(value[1], value[2], char1)
  74. end)
  75.  
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement