Needing Help with a Player-resize script

Hey there! So I’ve got a script that’s intended to resize the player (R15) upon touching the part (to which the script is the child).

Here’s what I’ve got:

script.Parent.Touched:Connect(function(Player)
local character = Player.Character
local Humanoid = character:FindFirstChild ('Humanoid')

if Humanoid then
	local BDS = Humanoid:FindFirstChild('BodyDepthScale')
	local BWS = Humanoid:FindFirstChild('BodyWidthScale')
	local BHS = Humanoid:FindFirstChild('BodyHeightScale')
	local HS = Humanoid:FindFirstChild('HeadScale')
	
	if BDS and BWS and BHS and HS then
		BDS.Value = 0.25
		BWS.Value = 0.2
		BHS.Value = 0.25
		HS.Value = 0.25
	end
end
end)

I’m not a scripter so I don’t know what’s wrong here. Would appreciate if anybody could point out/correct the issue, thanks :slight_smile:

Maybe do player instead of Player?

1 Like

The Touched event doesn’t pass a reference to a player to its listeners, it passes a reference to a part.

All you really need to do is change Player to part and change Player.Character to part.Parent.

1 Like

Thank you, works like a charm now!