Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

So i need help i cant find any way to change a mesh when touching a brick, can you guys help me?

I really need help i cant find any Evnts Functions Or anything at all! to change the mesh of a brick when you touch it

1 answer

✓ Accepted answer

This is pretty simple what you are asking for.

local Part = script.Parent -- put script in part (server script).
local Players = game:GetService('Players')

Part.Touched:Connect(function(otherPart)
	local Player = Player:GetPlayerFromCharacter(otherPart.Parent)
	if Player then -- check if the part touching is a player
		if Part:FindFirstChildOfClass('SpecialMesh') == nil then -- checks if no mesh
			local Mesh = Instance.new('SpecialMesh')
			Mesh.MeshType = Enum.MeshType.FileMesh
			Mesh.MeshId = 'rbxassetid://0' -- change 0 to your mesh id
		end
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.