R15 Sizing Script Convert to R6

Is it possible to convert this to R6? This script was built for R15.

If it isn’t possible, or if you have a solution please reply.

I changed the name of the number value- since there were a lot of ranks, right now this script is fully working.

image
Character Size

local Util = require(script.Util)
local Config = require(script.Config).Config

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local Role = player:GetRoleInGroup(Config.GroupId)
        local scale = 1
        
        if script.Sizing:FindFirstChild(Role)then
            scale = script.Sizing[Role].Value
        else    
            scale = Config.NotFoundScale
        end
        
        print(scale)
        local hum = character:WaitForChild("Humanoid")
        wait(1)
        Util.scale(character.Humanoid, scale)
    end)
end)

Config

local module = {
	Config = {
		GroupId = "4792643",
		NotFoundScale = 1
	}
}

return module

Util

local module = {}

function module.scale(hum,scl)
	hum.BodyDepthScale.Value = scl
	hum.BodyHeightScale.Value = scl
	hum.BodyProportionScale.Value = scl
	hum.BodyTypeScale.Value = scl
	hum.BodyWidthScale.Value = scl
	hum.HeadScale.Value = scl
end

return module

Any replies would be helpful as soon as possible. :smile:

function module.scale(char,scl) -- make sure to pass the character and not the hum
	for _,des in next, char:GetDescendants() do
		if des.ClassName:find("Part") or des:IsA("UnionOperation") then
			pcall(function() des.Size = Vector3.new(scl,scl,scl) end)
		end
	end
end

Edit:
This won’t really look correctly but it still works.

1 Like