Im trying to scale the player when you touch the part but the thing is I have an error and I cant figure it out. Here is the script:

local part = game.Workspace.Sizer
local Scale = 0.1

part.Touched:Connect(function(hit)
	local Humanoid = hit.Parent:FindFirstChild("Humanoid").HumanoidDescription
	if Humanoid then
		local Properties = {"DepthScale", "WidthScale"}

		repeat
			wait(0.01)
			for _, property in pairs(Properties) do
				Humanoid[property].Value = Humanoid[property].Value + Scale
			end
		until Humanoid.BodyWidthScale.Value >= 6
	end
end)

and this is the error:

 ServerScriptService.Script:12: attempt to index number with 'Value'

Thanks in advanced.

2 comments

0

What you tried to do is to set the values of HumanoidDescription, but apparently you don't have to define .Value. However, even though if you fix those parts the player won't really resize, to actually resize the player you have to change BodyWidthScale that are located in Humanoid, not HumanoidDescription.

0

Basically, to fix the script you need to remove .HumanoidDescription from Humanoid variable and change the DepthScale to BodyDepthScale and WidthScale to BodyWidthScale.