Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rankModule = require(script.Parent.Modules.GetRank)
- function updateAvatar(material, color, char)
- wait(0.1)
- for _, child in pairs(char:GetChildren()) do
- if child:IsA("BasePart") then
- child.Material = material
- child.Color = Color3.fromRGB(tonumber(color[1]), tonumber(color[2]), tonumber(color[3]))
- end
- end
- end
- local value = nil
- local char1 = nil
- game.Players.PlayerAdded:Connect(function(plr)
- plr.CharacterAdded:Connect(function(char)
- char1 = char
- wait(0.25)
- for _, child in pairs(char:GetChildren()) do
- if child:IsA("Accessory") then
- child:Destroy()
- end
- if child:IsA("Shirt") then
- child:Destroy()
- end
- if child:IsA("Pants") then
- child:Destroy()
- end
- if child:IsA("ShirtGraphic") then
- child:Destroy()
- end
- end
- value = rankModule.GetPlayerRank(plr.Name)
- wait(0.1)
- updateAvatar(value[1], value[2], char)
- end)
- plr:WaitForChild("leaderstats").RAP.Changed:Connect(function()
- value = rankModule.GetPlayerRank(plr.Name)
- updateAvatar(value[1], value[2], char1)
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement