Hi Everyone!

I want to make this size modifier which shrinks or grows depending on the number value given. Here is the script for the part

local SizeValue = script.Parent.SizeOfChar.Value -- child of the part
script.Parent.Touched:Connect(function(CharPart) -- when the player's character touches the part
	local humanoid = CharPart.Parent:FindFirstChild("Humanoid")
	if humanoid then
		if humanoid:FindFirstChild("BodyHeightScale") then
			humanoid.BodyHeightScale = SizeValue
		end
		if humanoid:FindFirstChild("BodyWidthScale") then
			humanoid.BodyWidthScale = SizeValue
		end
		if humanoid:FindFirstChild("BodyDepthScale") then
			humanoid.BodyDepthScale = SizeValue
		end
		if humanoid:FindFirstChild("HeadScale") then
			humanoid.HeadScale = SizeValue
		end
	end
end)

For some reason the script does not shrink the character. How should I fix this?

Any help is appreciated :)

3 comments

0

What is the value of SizeValue?

0

There seems to be nothing wrong with the script so I'm thinking it's something else. What is the ClassName of "script.Parent"?

0

size value is 0.5, and the class name is "Part"