Swim if you touch a part

Hey! im trying to make a script, that if you touch it, you swin. i tried this script but it didnt work? does someone have any solutions?

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:WaitForChild("Humanoid")
	if humanoid then
		humanoid:ChangeState(Enum.HumanoidStateType.Swimming, true)
	end
end)
2 Likes

Are there any errors in the output?

1 Like

no, there arent any errors in the output!

1 Like

try to remove the true!!!

1 Like

No, It didnt work. im very sorry!

Why are you sorry? No need to apologize for what I said, try to see if this will help: