Part changes material of player

i made this script a while ago with the help of this site, it changes the material of the player when the player touches it. is it possible to make the script change the material of whatever it touches? players AND parts?

workspace["Neon"].Touched:Connect(function(touch)
	if game.Players:GetPlayerFromCharacter(touch.Parent) then -- To verify if its a player
	local Childrens = touch.Parent:GetDescendants()-- Get the children
	for i,v in ipairs(Childrens) do  -- For loop through the Children
		if v:IsA("BasePart") then -- If v or value is a basepart (basepart is basically a superclass of all types of parts)
				v.Material = Enum.Material["Neon"] -- change the Material of v which is the part.
		end
	end
	end
end)

Yes! Simply remove this line:

if game.Players:GetPlayerFromCharacter(touch.Parent) then -- To verify if its a player

and don’t forget the end!

end -- the end for the if statement
1 Like

Oh, I forgot to mention, add this line aswell:

touch.Material = Enum.Material["Neon"]